Closed nkolev92 closed 1 year ago
@dominoFire commented on Mon, 20 Jul 2020 18:35:01 GMT
Please, fill all bug details in the form (nuget.exe version, dotnet.exe version, Windows version, VS version, ...)
@zkat commented on Thu, 06 Aug 2020 17:41:03 GMT This doesn't seem like a bug in our own codebase, but @dominoFire's request above should give us a better clue of where to take this :)
@jogibear9988 commented on Sat, 22 Aug 2020 07:38:02 GMT This repository shows the issue: https://github.com/jogibear9988/nugetIssue
@jogibear9988 commented on Sat, 22 Aug 2020 07:39:00 GMT Maybe it's an error in some of the nugets, but the error message in visual studio does not help. We had a huge solution, and I had to remove more and more projects and code files to find the root cause.
I'm facing this issue also but tried the following Steps but can't be fixed.
I started facing this issue suddenly, without adding any Nugets, updating any of the package versions, or modifying any of the project files in any way. I tried the msbuild structured log viewer and don't see anything there that I don't see in the output window. I tried deleting bin/obj folders, clearing nuget cache, and rebuilding the dependencies (deployed as locally sourced Nuget packages), all to no avail.
One example error line, which I find to be pretty nonsensical:
1>C:\Code\Entities\Data2\Data2.csproj : error NU1106: Unable to satisfy conflicting requests for 'TA.Util.Objects': TA.Util.Objects (>= 1.0.0) (via project/TA.Entities 1.0.0.0), TA.Util.Objects (>= 1.0.0) (via package/TA.Entities 1.0.0) Framework: (.NETCoreApp,Version=v6.0)
PS. I was able to resolve this by simplifying a few dependency graphs, basically, where the same package was referenced using a few paths (and no longer is). However, it worked before and suddenly stopped working, so I still think there is a problem.
Error in VS 2022
Build started...
Restored D:\code\nugetIssue\ClassLibrary1\ClassLibrary1.csproj (in 2.34 sec).
Failed to restore D:\code\nugetIssue\WpfApp1\WpfApp1.csproj (in 5.71 sec).
1>------ Build started: Project: ClassLibrary1, Configuration: Debug Any CPU ------
NuGet package restore failed. Please see Error List window for detailed warnings and errors.
1>ClassLibrary1 -> D:\code\nugetIssue\ClassLibrary1\bin\Debug\net48\ClassLibrary1.dll
2>------ Build started: Project: WpfApp1, Configuration: Debug Any CPU ------
2>D:\code\nugetIssue\WpfApp1\WpfApp1.csproj : error NU1106: Unable to satisfy conflicting requests for 'System.Reactive.Linq': System.Reactive.Linq (>= 4.3.1) (via package/RoslynPad.Editor.Windows 1.2.0), System.Reactive.Linq (>= 3.1.1) (via package/System.Reactive.PlatformServices 3.1.1) Framework: (.NETFramework,Version=v4.8)
2>D:\code\nugetIssue\WpfApp1\WpfApp1.csproj : error NU1106: Unable to satisfy conflicting requests for 'System.Reactive': System.Reactive (>= 4.3.1) (via package/System.Reactive.Linq 4.3.1), System.Reactive (>= 3.1.1) (via package/Workstation.UaClient 2.1.1) Framework: (.NETFramework,Version=v4.8)
2>D:\code\nugetIssue\WpfApp1\WpfApp1.csproj : error NU1106: Unable to satisfy conflicting requests for 'System.Threading.Tasks.Extensions': System.Threading.Tasks.Extensions (>= 4.5.3) (via package/System.Reactive.Linq 4.3.1), System.Threading.Tasks.Extensions (>= 4.5.3) (via package/Microsoft.CodeAnalysis.Common 3.6.0), System.Threading.Tasks.Extensions (>= 4.5.3) (via package/Microsoft.CodeAnalysis.Common 3.6.0), System.Threading.Tasks.Extensions (>= 4.5.3) (via package/Microsoft.CodeAnalysis.Features 3.6.0), System.Threading.Tasks.Extensions (>= 4.5.3) (via package/Microsoft.CodeAnalysis.Common 3.6.0), System.Threading.Tasks.Extensions (>= 4.5.3) (via package/Microsoft.CodeAnalysis.Common 3.6.0), System.Threading.Tasks.Extensions (>= 4.5.2) (via package/Microsoft.Bcl.AsyncInterfaces 1.1.0), System.Threading.Tasks.Extensions (>= 4.5.2) (via package/Microsoft.Bcl.AsyncInterfaces 1.1.0) Framework: (.NETFramework,Version=v4.8)
2>D:\code\nugetIssue\WpfApp1\WpfApp1.csproj : error NU1106: Unable to satisfy conflicting requests for 'System.ValueTuple': System.ValueTuple (>= 4.4.0) (via package/Workstation.UaClient 2.1.1), System.ValueTuple (>= 4.5.0) (via package/System.Reactive 4.3.1) Framework: (.NETFramework,Version=v4.8)
2>D:\code\nugetIssue\WpfApp1\WpfApp1.csproj : error NU1106: Unable to satisfy conflicting requests for 'System.Runtime.CompilerServices.Unsafe': System.Runtime.CompilerServices.Unsafe (>= 4.7.0) (via package/Microsoft.CodeAnalysis.Common 3.6.0), System.Runtime.CompilerServices.Unsafe (>= 4.7.0) (via package/Microsoft.CodeAnalysis.Common 3.6.0), System.Runtime.CompilerServices.Unsafe (>= 4.7.0) (via package/Microsoft.CodeAnalysis.Common 3.6.0), System.Runtime.CompilerServices.Unsafe (>= 4.7.0) (via package/Microsoft.CodeAnalysis.Common 3.6.0), System.Runtime.CompilerServices.Unsafe (>= 4.5.2) (via package/System.Threading.Tasks.Extensions 4.5.3), System.Runtime.CompilerServices.Unsafe (>= 4.5.2) (via package/System.Threading.Tasks.Extensions 4.5.3), System.Runtime.CompilerServices.Unsafe (>= 4.4.0) (via package/Microsoft.Extensions.Primitives 2.0.0), System.Runtime.CompilerServices.Unsafe (>= 4.5.2) (via package/System.Threading.Tasks.Extensions 4.5.2), System.Runtime.CompilerServices.Unsafe (>= 4.5.2) (via package/System.Threading.Tasks.Extensions 4.5.2), System.Runtime.CompilerServices.Unsafe (>= 4.4.0) (via package/Microsoft.Extensions.Primitives 2.0.0), System.Runtime.CompilerServices.Unsafe (>= 4.4.0) (via package/Microsoft.Extensions.Primitives 2.0.0) Framework: (.NETFramework,Version=v4.8)
2>D:\code\nugetIssue\WpfApp1\WpfApp1.csproj : error NU1106: Unable to satisfy conflicting requests for 'System.Reactive.PlatformServices': System.Reactive.PlatformServices (>= 3.1.1) (via package/System.Reactive 3.1.1) Framework: (.NETFramework,Version=v4.8)
2>D:\code\nugetIssue\WpfApp1\WpfApp1.csproj : error NU1106: Unable to satisfy conflicting requests for 'System.Reactive.Windows.Threading': System.Reactive.Windows.Threading (>= 3.1.1) (via package/System.Reactive 3.1.1) Framework: (.NETFramework,Version=v4.8)
2>D:\code\nugetIssue\WpfApp1\WpfApp1.csproj : error NU1106: Unable to satisfy conflicting requests for 'System.Reactive.Core': System.Reactive.Core (>= 3.1.1) (via package/System.Reactive.Windows.Threading 3.1.1), System.Reactive.Core (>= 3.1.1) (via package/System.Reactive.Linq 3.1.1) Framework: (.NETFramework,Version=v4.8)
2>D:\code\nugetIssue\WpfApp1\WpfApp1.csproj : error NU1106: Unable to satisfy conflicting requests for 'System.Reactive.Interfaces': System.Reactive.Interfaces (>= 3.1.1) (via package/System.Reactive.Core 3.1.1), System.Reactive.Interfaces (>= 3.1.1) (via package/System.Reactive.Core 3.1.1) Framework: (.NETFramework,Version=v4.8)
2>Done building project "WpfApp1.csproj" -- FAILED.
Package Workstation.UaClient
in classlibrary1 and RoslynPad.Editor.Windows
causes a conflict in the version of System.Reactive.Linq
. So ToDictionary
fails because there are 2 packages with same name (but different versions). VS does show error from NuGet end about conflict to let user know about conflict. (The error message could be made more actionable). For task failure, either we suppress it or point to nuget errors (repeating same error as nuget showing won't be much useful).
As per @dsplaisted in https://github.com/dotnet/sdk/pull/30105#issuecomment-1476974149
I tried repro on 7.0.200. The error doesn't show up in error list anymore. Closing as fixed.
@jogibear9988 commented on Sun, 19 Jul 2020 08:00:16 GMT Error MSB4018 The "ResolvePackageDependencies" 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.Dictionaryd__26.MoveNext()
2.Insert(TKey key, TValue value, Boolean add) at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable
1 source, Func2 keySelector, Func
2 elementSelector, IEqualityComparer`1 comparer) at Microsoft.NET.Build.Tasks.ResolvePackageDependencies.GetPackageAndFileDependencies(LockFileTarget target) at Microsoft.NET.Build.Tasks.ResolvePackageDependencies.RaiseLockFileTargets() at Microsoft.NET.Build.Tasks.ResolvePackageDependencies.ExecuteCore() at Microsoft.NET.Build.Tasks.TaskBase.Execute() at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() at Microsoft.Build.BackEnd.TaskBuilder.Details about Problem
VS UI
Detailed repro steps so we can see the same problem
I have a complex Solution. This error I get after some Nuget Updates during build.
How can I find out wich Nuget is causing the issue and why?