Open hickford opened 1 month ago
Without packages.config, upgrade works as expected:
nuget install NUnit -Version 3.0.0 -ExcludeVersion
nuget install NUnit -Version 3.14.0 -ExcludeVersion
Logs show that the old package is uninstalled:
Successfully uninstalled 'NUnit.3.0.0' from C:\code\nuget-playground\single-version
Adding package 'NUnit.3.14.0' to folder 'C:\code\nuget-playground\single-version'
Added package 'NUnit.3.14.0' to folder 'C:\code\nuget-playground\single-version'
Successfully installed 'NUnit 3.14.0' to C:\code\nuget-playground\single-version
I don't really know if restoring from packages.config and ExcludeVersion are really expected to be combined.
Likely low impact, but we'd be happy to consider a fix.
@nkolev92 There's nothing in the docs to say you can't use packages.config and ExcludeVersion together https://learn.microsoft.com/en-us/nuget/reference/cli-reference/cli-ref-install
A GitHub code search for the combination has thousands of results https://github.com/search?q=ExcludeVersion+packages.config&type=code
NuGet Product Used
NuGet.exe
Product Version
6.9.1.3
Worked before?
No response
Impact
It's more difficult to complete my work
Repro Steps & Context
Run
nuget install packages.config -ExcludeVersion
Edit packages.config:
Run
nuget install packages.config -ExcludeVersion
Inspect NUnit folder. You'll find the installation is a mix of versions 3.0.0 and 3.14.0. Here's a comparison with Powershell's
Get-FileHash
It looks like old files aren't deleted or overwritten.
Verbose Logs