NuGet / Home

Repo for NuGet Client issues
Other
1.5k stars 253 forks source link

[Bug Bash] The installed package is not the latest version of the selected package source when installing a package with floating version “*” #12602

Open CiciLi1 opened 1 year ago

CiciLi1 commented 1 year ago

NuGet Product Used

Visual Studio Package Management UI

Product Version

NuGet Client Dev\6.7.0.45

Worked before?

No response

Impact

It bothers me. A fix would be nice

Repro Steps & Context

Repro Steps:   

  1. Add a deprecated package source https://apidev.nugettest.org/v3-index/index.json (source 1).

  2. Create a C# Console App (.Net core) project in VS.   

  3. Right-click the project in Solution Explorer and select "Manage NuGet Packages…" menu item to open PM UI.   

  4. Click settings button (top-right of right panel), only check the newly added deprecated package source (source 1) & "Microsoft Visual Studio Offline Packages" package source (source 2) and uncheck the other package sources.

  5. Select the "Microsoft Visual Studio Offline Packages" package source (source 2) from “Package source” dropdown list, go to "Browse" tab and click a package (for example "Newtonsoft.Json").  

  6. Clear the "Version" drop-down box in the right panel.

  7. Type a floating version “*” in the “Version” drop-down box and click the “Install” button.

Expected:   

The installed package is the latest version 4.0.1 of the selected package source (source 2).

Actual:   

The installed package is not the latest version of the selected package source (it installed the latest version 4.7.0 from the unselected package source-source 1) when installing a package with floating version “*”as below screenshot: MicrosoftTeams-image

Notes:  

  1. The repro rate is 100%.   

  2. It repro on D17.5\33530.505.d17.5 + Dev\6.0.5.154

Verbose Logs

No response

jebriede commented 1 year ago

I was able to repro using the package sources mentioned above and using Microsoft.CSharp as an example package.

CiciLi1 commented 1 month ago

It still reproes on VS Main\35222.175 + NuGet Client Dev\6.12.0.82.