-
Notifications
You must be signed in to change notification settings - Fork 256
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
Nuget Packages Manager screen for Solution automatically selects transitive dependencies #13893
Comments
This! |
If:
then the NuGet package manager in Visual Studio should:
Update Package X:
|
Any news on this one? It makes updating packages in VS really difficult. |
Agreed. Was this a mistake or did someone actually think this default behaviour was a good idea? If I have a main project "A" (e.g. a Web API) with a dependency on a class library project "B" (e.g. some Data Access DLL) which in turn depends on some DB-access NuGet packages, I don't think anyone wants the default behaviour of "Update NuGet packages for solution" to be "include all transitive packages from dependent-project B in main-project A". As of today I have to manually un-select the transitive dependencies, so that only the class library project's (top-level) dependency gets updated. Very cumbersome in a large project, as this has to be done for each NuGet package. Or, use the "Update NuGet packages" on a project by project basis. There are, of course, occasions where one might want to explicitly install a transitive dependency in the "main" project, but I'd assume that's usually the exception and not the norm... |
I just went through one of many solutions, this is painful, please fix it (not mentioning the LTS vs STS... but that is another issue) |
@martinrrm thanks for listening to our feedback! |
Just want to check when we can expect this to be fixed on Visual Studio 22. I just updated to preview version to check if it has been fixed (17.13.0 Preview 2.1), but it still selects transitive packages when I try to update packages on the solution. |
This is fixed in Visual Studio 2022 v17.13 preview 4 which was released on 28 January 2025. |
Thanks for the update, can confirm NuGet package Manager only select Top-level dependencies when trying to update packages. Thanks |
This issue has been moved from a ticket on Developer Community.
In the Nuget Packages Manager screen for solution, in the "Updates" list, when selecting a package to update, all the projects when the package is top-level AND transitive are automatically selected.
Clicking the Update button (underneath the Uninstall button) will update the package reference for the top-level registration, but also add a package reference in all the projects where the package is used as a transitive dependency. Which is not the intended use of transitive dependencies.
I would expect to only have the project where the dependency is a top-level one to be selected automatically.
The solution I'm working with a .NET Framework 4.8 solution, using PackageReference and with SDK-style projects.
PS: when updating multiple packages at once, by selecting them in the package list of the Update tab, and clicking the "Update" button located on top of that list, only the projects where the dependencies are top-level are updated, which is the intended behavior.
Original Comments
Feedback Bot on 28/10/2024, 00:10 PM:
We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.
The text was updated successfully, but these errors were encountered: