Skip to content

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

@jeffkl

Description

@jeffkl

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions