You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[DCR]: When installing a package in VS with central package management, update all projects in the solution #11912
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.
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.
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.
Activity
nkolev92 commentedon Jun 23, 2022
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 commentedon Jun 28, 2022
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.