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

[DCR]: When installing a package in VS with central package management, update all projects in the solution #11912

Open
jeffkl opened this issue Jun 23, 2022 · 2 comments
Labels
Area:RestoreCPM Central package management Functionality:Restore Priority:2 Issues for the current backlog. Type:DCR Design Change Request

Comments

@jeffkl
Copy link
Contributor

jeffkl commented Jun 23, 2022

NuGet Product(s) Affected

Visual Studio Package Management UI, Visual Studio Package Manager Console

Current Behavior

Currently when install a package to a project in Visual Studio, NuGet updates the in-memory representation of the project spec and executes a preview restore to ensure the package is compatible with the project. If this succeeds, the project changes are committed and Visual Studio/Project System will nominate the project for restore but nothing happens since the preview restore already ran. However, when using central package management (CPM), an item is updated in Directory.Packages.props which could cause multiple projects to need to be restored across the solution after installing a package.

Desired Behavior

NuGet should look into whether or not its feasible to execute this preview restore on all projects affected by the package installation. Right now we only restore a single project but NuGet could detect that multiple projects are affected and include them. That way when changes are committed and Project System nominates them, everything would no-op.

Additional Context

Related to NuGet/NuGet.Client#4642

@jeffkl jeffkl added Type:DCR Design Change Request Area:RestoreCPM Central package management labels Jun 23, 2022
@nkolev92 nkolev92 added the Priority:2 Issues for the current backlog. label Jun 23, 2022
@nkolev92
Copy link
Member

Some more clarifications.

When installing a package in non-CPM project, that project and all its parents are restored in the preview, hence how we get to a no-op after the package has completed installing.

@kartheekp-ms
Copy link
Contributor

When installing a package in non-CPM project, that project and all its parents are restored in the preview

In CPM's case, my understanding is that other unrelated projects within the same solution may be impacted because of the updates to the package version centrally.

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:2 Issues for the current backlog. Type:DCR Design Change Request
Projects
None yet
Development

No branches or pull requests

3 participants