Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The "ResolvePackageDependencies" task failed unexpectedly - An item with the same key has already been added #9818

Closed
jogibear9988 opened this issue Jul 19, 2020 · 4 comments
Labels
Area:RestoreRepeatableBuild The lock file features Functionality:VisualStudioUI Partner:MSBuild Priority:3 Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog. Resolution:External This issue appears to be External to nuget Type:Bug WaitingForCustomer Applied when a NuGet triage person needs more info from the OP

Comments

@jogibear9988
Copy link

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.Dictionary2.Insert(TKey key, TValue value, Boolean add) at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable1 source, Func2 keySelector, Func2 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.d__26.MoveNext()

Details about Problem

VS UI

Detailed repro steps so we can see the same problem

  1. I have a complex Solution. This error I get after some Nuget Updates during build.

  2. How can I find out wich Nuget is causing the issue and why?

@dominoFire
Copy link
Contributor

dominoFire commented Jul 20, 2020

Please, fill all bug details in the form (nuget.exe version, dotnet.exe version, Windows version, VS version, ...)

@dominoFire dominoFire added Partner:MSBuild Area:RestoreRepeatableBuild The lock file features Functionality:VisualStudioUI WaitingForCustomer Applied when a NuGet triage person needs more info from the OP labels Jul 20, 2020
@zkat zkat added Priority:3 Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog. Resolution:External This issue appears to be External to nuget Type:Bug labels Aug 6, 2020
@zkat
Copy link
Contributor

zkat commented Aug 6, 2020

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
Copy link
Author

This repository shows the issue:
https://github.com/jogibear9988/nugetIssue

@jogibear9988
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area:RestoreRepeatableBuild The lock file features Functionality:VisualStudioUI Partner:MSBuild Priority:3 Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog. Resolution:External This issue appears to be External to nuget Type:Bug WaitingForCustomer Applied when a NuGet triage person needs more info from the OP
Projects
None yet
Development

No branches or pull requests

4 participants