Skip to content
This repository has been archived by the owner on Dec 18, 2017. It is now read-only.

InvalidOperation exception when publishing app with csproj and xproj #2476

Closed
glennc opened this issue Aug 13, 2015 · 3 comments
Closed

InvalidOperation exception when publishing app with csproj and xproj #2476

glennc opened this issue Aug 13, 2015 · 3 comments

Comments

@glennc
Copy link
Member

glennc commented Aug 13, 2015

I have an application that has several xprojs that reference some csproj projects. When publishing with source they suffer from this bug: #2352

However, if I add --no-source then I get the following:

...
Done, without errors.
Copying to output path C:\Users\glennc\AppData\Local\Temp\PublishTemp
System.InvalidOperationException: Sequence contains more than one matching element
   at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
   at Microsoft.Framework.PackageManager.BuildContext.PopulateDependencies(PackageBuilder packageBuilder)
   at Microsoft.Framework.PackageManager.BuildManager.BuildInternal(String projectPath)
   at Microsoft.Framework.PackageManager.BuildManager.Build()
   at Microsoft.Framework.PackageManager.Publish.PublishProject.EmitNupkg(PublishRoot root)
   at Microsoft.Framework.PackageManager.Publish.PublishProject.Emit(PublishRoot root)
   at Microsoft.Framework.PackageManager.Publish.PublishRoot.Emit()
   at Microsoft.Framework.PackageManager.Publish.PublishManager.Publish()
   at Microsoft.Framework.PackageManager.PublishConsoleCommand.<>c__DisplayClass0_0.<Register>b__1()
   at Microsoft.Framework.Runtime.Common.CommandLine.CommandLineApplication.Execute(String[] args)
   at Microsoft.Framework.PackageManager.Program.Main(String[] args)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.Framework.Runtime.Common.EntryPointExecutor.Execute(Assembly assembly, String[] args, IServiceProvider serviceProvider)
   at dnx.host.Bootstrapper.RunAsync(List`1 args, IRuntimeEnvironment env, FrameworkName targetFramework)
   at dnx.host.RuntimeBootstrapper.ExecuteAsync(String[] args, FrameworkName targetFramework)
   at dnx.host.RuntimeBootstrapper.Execute(String[] args, FrameworkName targetFramework)
@davidfowl
Copy link
Member

/cc @ChengTian

@ChengTian
Copy link
Contributor

Tried building some applications where xprojs reference csprojs but couldn't reproduce. This should only happen in some specific scenarios.

I need to have a look at the application @glennc used in order to investigate.

@ChengTian
Copy link
Contributor

This publish issue was in beta6 and it was fixed during @davidfowl 's refactoring (the usage of SingleOrDefault was removed during the refactoring 307137a)

However, dnu restore suffers from similar issue now and I filed a bug for it at: #2554

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants