NuGet / Home

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

[Bug Bash] NuGet restore doesn’t work after checking the “Allow NuGet to download missing packages” in Options dialog for C# Console App (.NET 8.0) #13191

Open v-luzh opened 9 months ago

v-luzh commented 9 months ago

NuGet Product Used

Visual Studio Package Management UI

Product Version

Dev\6.10.0.13

Worked before?

It is not a regression since it reproduced on D16.11\34301.259.

Impact

It bothers me. A fix would be nice

Repro Steps & Context

Repro Steps:

  1. Create a C# Console App (.NET 8.0) project in VS and open the PM UI window.
  2. Install several packages (e.g. Newtonsoft.Json and log4net), go to the path “C:\Users[username].nuget\packages” and delete an installed package (e.g. log4net) from the packages folder.
  3. Click the settings button (gear button) on PM UI or PMC window.
  4. Click the NuGet Package Manager->General in the opened “Options” window.
  5. Check the “Allow NuGet to download missing packages” and click OK button.
  6. Right-click the solution node in Solution Explorer and click "Restore NuGet Packages".
  7. Go back to the path “C:\Users[username].nuget\packages” and observe.

Expected Result:

The lost packages had been restored back to the global packages folder successfully.

Actual Result:

The lost package was not restored back to the global packages folder in step7 and the info “all packages are already installed an there is nothing to restore” in step6.

Notes:

1.Repro rate: 100%. 2.It doesn’t repro for iOS (Xamarin) App/C# UWP project. 3.It doesn’t repro when deleting the whole “packages” folder from the path “C:\Users[username].nuget”.

nkolev92 commented 8 months ago

This is a known limitation of https://github.com/NuGet/Home/blob/dev/accepted/archive/VisualStudio-PartialRestoreOptimization.md.

At this point, the perf benefits outweigh the likelihood of this edge case happening (we haven't heard any issues) around this.

We're gonna leave this open to potentially collect upvotes, but we're not likely to change it.

SueSu01 commented 2 months ago

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