NuGet / Home

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

[Bug Bash] The offline package source cannot be enabled after disabling it from the ‘Machine-wide package sources’ source list previously in the ‘Options->NuGet Package Manager->Package Sources’ window #13434

Open v-luzh opened 5 months ago

v-luzh commented 5 months ago

NuGet Product Used

Visual Studio Package Management UI

Product Version

Dev\6.11.0.49

Worked before?

It is a regression since it doesn’t repro on D16.11\34601.136, but reproes on D17.9\34601.282.

Impact

It bothers me. A fix would be nice

Repro Steps & Context

Repro Steps:

  1. Create a C# Console App (.NET Core 8.0) project in VS.
  2. Right-click the project in Solution Explorer window and select ‘Manage NuGet Packages…’ menu item to open PM UI.
  3. Click the settings button (gear button) in PM UI.
  4. Click the ‘NuGet Package Manager->Package Sources’ in the opened ‘Options’ window.
  5. Disable the source ‘Microsoft Visual Studio Offline Packages’ in the source list ‘Machine-wide package sources’ and click the ‘OK’ button.
  6. Click the settings button (gear button) in PM UI again.
  7. Enable the source ‘Microsoft Visual Studio Offline Packages’ again and click the ‘OK’ button.
  8. Observe the drop-down list ‘Package sources’ or reopen the ‘Options->NuGet Package Manager->Package Sources’ window again.

Expected Result:

The offline package source should be enabled again.

Actual Result:

The offline package source cannot be enabled again as recorded below. OfflinePackageSourceDisabled

Notes:

  1. Repro rate: 100%.
  2. It also reproes in the solution-level PM UI.
  3. This bug will be fixed automatically after closing VS and create another solution, so it only reproes on clean machines.

Verbose Logs

No response

nkolev92 commented 5 months ago

@v-luzh

Can you please help us figure out when this regressed.

jeffkl commented 5 months ago

Before modifying the settings, the machine-wide feed shows up in a different section of this settings dialog

image

Unchecking the feed results in this being added to the user-wide config:

  <disabledPackageSources>
    <add key="Microsoft Visual Studio Offline Packages" value="true" />
  </disabledPackageSources>

Now the feed is no longer considered machine-wide:

image

v-luzh commented 5 months ago

@v-luzh

Can you please help us figure out when this regressed.

  • Please try 17.7 and 17.8

Hi @nkolev92, it reproes on both D17.7\34003.232 with implicit NuGet Client 6.7.0.127 and D17.8\34309.116 with implicit NuGet Client 6.8.0.131.

nkolev92 commented 5 months ago

Turns out guess was incorrect.

Can you try 17.0 and 17.5 as well.

Thanks!

v-luzh commented 4 months ago

Hi @nkolev92, it doesn't repro on D17.0\31903.59 with implicit NuGet Client 6.0.0.275, but reproes on D17.5\33414.496 with implicit NuGet Client 6.5.0.154.

And we found if the offline source is still considered as machine-wide source (listed under the 'Machine-wide package sources' list) after the first-disabling in step5, the bug will not repro. If the offline source is no longer considered as machine-wide source (considered as package source instead) after the first-disabling in step5, the bug will repro.

martinrrm commented 2 months ago

@v-luzh Hi can you try again and look at the configuration files before and after disabling the source?

You can look at the configuration files in Options -> NuGet Package Manager -> Configuration files and double click on them so they open in your VS editor.

v-luzh commented 2 months ago

Hi @martinrrm, here is the configuration files comparison: image

SueSu01 commented 1 month ago

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