Repro steps
Expected result
Actual result
3>ConsoleApp -> C:\...\bin\Debug\netcoreapp1.0\ConsoleApp.dll
3>C:\...\Microsoft.NET.Sdk.targets(77,5): error MSB4018: The "GenerateDepsFile" task failed unexpectedly.
3>C:\...\Microsoft.NET.Sdk.targets(77,5): error MSB4018: System.Exception: Could not find valid a SingleProjectInfo for project 'C:\...\ClassLibrary2.csproj'
@piotrpMSFT, @livarcocc, @jgoshi: let us know if this gives you enough info to get unblocked by adding appropriate project refs.
@srivatsn, @dsplaisted: FYI
@nguerrera Yes this got us unblocked.
+1
For whose like me trying to figure out what's wrong with build, I post workaround here:
Just add reference to ClassLibrary2 to your ConsoleApp project, and build will succeed.
Well, this sucks. Just started a new enterprise-scale application and it's broken already. After trying the workaround above, I get the following exception:
Error MSB4018 The "GenerateDepsFile" task failed unexpectedly.
System.ArgumentException: An item with the same key has already been added.
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
at Microsoft.Extensions.DependencyModel.DependencyContextWriter.WritePortableTarget(IReadOnlyList`1 runtimeLibraries, IReadOnlyList`1 compilationLibraries)
at Microsoft.Extensions.DependencyModel.DependencyContextWriter.WriteTargets(DependencyContext context)
at Microsoft.Extensions.DependencyModel.DependencyContextWriter.Write(DependencyContext context)
at Microsoft.Extensions.DependencyModel.DependencyContextWriter.Write(DependencyContext context, Stream stream)
at Microsoft.NET.Build.Tasks.GenerateDepsFile.ExecuteCore()
at Microsoft.NET.Build.Tasks.TaskBase.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() fluid-cms-site C:\Users\Ryan\.nuget\packages\microsoft.net.sdk\1.0.0-alpha-20161104-2\build\Microsoft.NET.Sdk.targets 77
@rocifier Sorry about that. Would you mind opening a separate issue and providing the repro steps?
@nguerrera It's strange. I don't feel confident to open a new issue about this yet. Sometimes I can fix the problem by rebuilding the solution. Restoring packages for the solution is what seems to break it. The problem now is that I can't consistently reproduce this, but I am living in fear of it breaking at any moment..
The error message here was improved. However since we are doing transitive P2Ps now we shouldn't get into this situation. Closing this issue. @rocifier if you see a repro for the crash mentioned above please file a separate issue.
@rocifier did you ever open a separate issue for the problem you raised on Dec 12? I'm running into the same issue you are seeing (using dotnet 2.0.0-preview1-005977).
No, I was never able to reproduce it again. I think I re-opened visual studio and rebuilt or something, and the problem went away. These days I tend to see better errors such as a trace of which packages are conflicting and from where. 95% of the time it is different versions of Newtonsoft.Json being used from different libraries.