Skip to content

[Bug]: Installing a package in Visual Studio when using central package management results in an error before projects can be modified #11828

@jeffkl

Description

@jeffkl

NuGet Product Used

Visual Studio Package Management UI

Product Version

Latest

Worked before?

No

Impact

I'm unable to use this version

Repro Steps & Context

When installing a new package in Visual Studio, NuGet attempts to preview the restore by modifying the graph and running the restore without committing it to disk. However, the package dependency that gets added to the graph does not take into account that central package management is in use so the preview restore fails. We need to update this code to modify the restore graph and take CPM into account.

https://github.com/NuGet/NuGet.Client/blob/3e6b1e48ad1d54563e0dd1370eece3d163a5e79f/src/NuGet.Core/NuGet.ProjectModel/PackageSpecOperations.cs#L145-L150

Verbose Logs

No response

Metadata

Metadata

Assignees

Labels

Area:RestoreCPMCentral package managementPriority:1High priority issues that must be resolved in the current sprint.Type:Bug

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions