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

Given key was not present in dictionary error in NuGet.RestoreEx.targets #13911

Open
shrkumari-ms opened this issue Nov 6, 2024 · 1 comment
Labels
Area:RestoreCPM Central package management Functionality:Restore Priority:3 Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog. Type:Bug

Comments

@shrkumari-ms
Copy link

NuGet Product Used

NuGet.exe

Product Version

6.5

Worked before?

No response

Impact

It's more difficult to complete my work

Repro Steps & Context

This issue is being observed when I am trying to refer the package "Microsoft.Azure.Compute.Web.Shared". This can be reproduced by adding the package reference to this package.

Verbose Logs

1>D:\dbs\Cx\azco\.A\MsBuild.Corext.pPZSQybD-IzL6xrphQZttA\Current\bin\amd64\NuGet.RestoreEx.targets(19,5): error : The given key was not present in the dictionary. [D:\dbs\el\azco\temp-msbuild-restore\dirs.proj]
D:\dbs\Cx\azco\.A\MsBuild.Corext.pPZSQybD-IzL6xrphQZttA\Current\bin\amd64\NuGet.RestoreEx.targets(19,5): error :    at System.ThrowHelper.ThrowKeyNotFoundException() [D:\dbs\el\azco\temp-msbuild-restore\dirs.proj]
D:\dbs\Cx\azco\.A\MsBuild.Corext.pPZSQybD-IzL6xrphQZttA\Current\bin\amd64\NuGet.RestoreEx.targets(19,5): error :    at System.Collections.Generic.Dictionary`2.get_Item(TKey key) [D:\dbs\el\azco\temp-msbuild-restore\dirs.proj]
D:\dbs\Cx\azco\.A\MsBuild.Corext.pPZSQybD-IzL6xrphQZttA\Current\bin\amd64\NuGet.RestoreEx.targets(19,5): error :    at NuGet.Commands.LockFileBuilder.<GetLibraryDependenciesForCentralTransitiveDependencies>d__13.MoveNext() [D:\dbs\el\azco\temp-msbuild-restore\dirs.proj]
D:\dbs\Cx\azco\.A\MsBuild.Corext.pPZSQybD-IzL6xrphQZttA\Current\bin\amd64\NuGet.RestoreEx.targets(19,5): error :    at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) [D:\dbs\el\azco\temp-msbuild-restore\dirs.proj]
D:\dbs\Cx\azco\.A\MsBuild.Corext.pPZSQybD-IzL6xrphQZttA\Current\bin\amd64\NuGet.RestoreEx.targets(19,5): error :    at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source) [D:\dbs\el\azco\temp-msbuild-restore\dirs.proj]
D:\dbs\Cx\azco\.A\MsBuild.Corext.pPZSQybD-IzL6xrphQZttA\Current\bin\amd64\NuGet.RestoreEx.targets(19,5): error :    at NuGet.Commands.LockFileBuilder.AddCentralTransitiveDependencyGroupsForPackageReference(PackageSpec project, LockFile lockFile, IEnumerable`1 targetGraphs) [D:\dbs\el\azco\temp-msbuild-restore\dirs.proj]
D:\dbs\Cx\azco\.A\MsBuild.Corext.pPZSQybD-IzL6xrphQZttA\Current\bin\amd64\NuGet.RestoreEx.targets(19,5): error :    at NuGet.Commands.LockFileBuilder.CreateLockFile(LockFile previousLockFile, PackageSpec project, IEnumerable`1 targetGraphs, IReadOnlyList`1 localRepositories, RemoteWalkContext context, LockFileBuilderCache lockFileBuilderCache) [D:\dbs\el\azco\temp-msbuild-restore\dirs.proj]
D:\dbs\Cx\azco\.A\MsBuild.Corext.pPZSQybD-IzL6xrphQZttA\Current\bin\amd64\NuGet.RestoreEx.targets(19,5): error :    at NuGet.Commands.RestoreCommand.BuildAssetsFile(LockFile existingLockFile, PackageSpec project, IEnumerable`1 graphs, IReadOnlyList`1 localRepositories, RemoteWalkContext contextForProject) [D:\dbs\el\azco\temp-msbuild-restore\dirs.proj]
D:\dbs\Cx\azco\.A\MsBuild.Corext.pPZSQybD-IzL6xrphQZttA\Current\bin\amd64\NuGet.RestoreEx.targets(19,5): error :    at NuGet.Commands.RestoreCommand.<ExecuteAsync>d__68.MoveNext() [D:\dbs\el\azco\temp-msbuild-restore\dirs.proj]
D:\dbs\Cx\azco\.A\MsBuild.Corext.pPZSQybD-IzL6xrphQZttA\Current\bin\amd64\NuGet.RestoreEx.targets(19,5): error : --- End of stack trace from previous location where exception was thrown --- [D:\dbs\el\azco\temp-msbuild-restore\dirs.proj]
D:\dbs\Cx\azco\.A\MsBuild.Corext.pPZSQybD-IzL6xrphQZttA\Current\bin\amd64\NuGet.RestoreEx.targets(19,5): error :    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() [D:\dbs\el\azco\temp-msbuild-restore\dirs.proj]
D:\dbs\Cx\azco\.A\MsBuild.Corext.pPZSQybD-IzL6xrphQZttA\Current\bin\amd64\NuGet.RestoreEx.targets(19,5): error :    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) [D:\dbs\el\azco\temp-msbuild-restore\dirs.proj]
D:\dbs\Cx\azco\.A\MsBuild.Corext.pPZSQybD-IzL6xrphQZttA\Current\bin\amd64\NuGet.RestoreEx.targets(19,5): error :    at NuGet.Commands.RestoreRunner.<ExecuteAsync>d__7.MoveNext() [D:\dbs\el\azco\temp-msbuild-restore\dirs.proj]
@donnie-msft
Copy link
Contributor

donnie-msft commented Nov 9, 2024

I wasn't able to reproduce this issue as I can't find that package. Could you let us know where to find it?

However, the CPM exception doesn't look right. It appears CPM is still looking for the version for that package. Sending to triage so CPM experts can take a look.

@donnie-msft donnie-msft added Triage:NeedsTriageDiscussion WaitingForCustomer Applied when a NuGet triage person needs more info from the OP Area:RestoreCPM Central package management and removed Triage:Untriaged labels Nov 9, 2024
@nkolev92 nkolev92 added Priority:3 Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog. Functionality:Restore and removed Triage:NeedsTriageDiscussion WaitingForCustomer Applied when a NuGet triage person needs more info from the OP labels Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area:RestoreCPM Central package management Functionality:Restore Priority:3 Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog. Type:Bug
Projects
None yet
Development

No branches or pull requests

3 participants