Open einsteine89 opened 2 weeks ago
This is intentional due to the fact that within the context of a project, we'll never know how many projects the Directory.Packages.props applies to.
There's a related idea that'd prune all the potentially unused package versions: https://github.com/NuGet/Home/issues/9024
Team Triage: It is unlikely that we'd add something that prunes package versions by default, as we cannot know for sure that the Directory.Packages.props applies to only the projects within the context we're restoring.
The approach would probably have to be something that the user opts into, such as a commandline argument or an option in the UI.
NuGet Product Used
Visual Studio Package Management UI, Visual Studio Package Manager Console
Product Version
dotnet 8.0.300, Visual Studio Professional 2022 17.10.0
Worked before?
No response
Impact
It's more difficult to complete my work
Repro Steps & Context
When using Central Package Management with
Directory.Packages.props
file on solution level, trying to uninstall a package from Visual Studio Package Management UI or via Package Management Console results in the package being removed from all the.csproj
files but it still remains in theDirectory.Packages.props
.Steps to reproduce:
Directory.Packages.props
file with this content.csproj
andDirectory.Packages.props
files being updated.csproj
file being updated butDirectory.Packages.props
notVerbose Logs
No response