Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug Bash] The package source will switch to ‘nuget.org’ automatically after installing a "PackageReference" package from a source other than ‘nuget.org’ in a non-SDK style project #14152

Open
ZheeYoong1125 opened this issue Feb 28, 2025 · 0 comments
Labels
Area:Settings NuGet.Config and related issues Found:ManualTests Functionality:Install The install command in VS/nuget.exe Functionality:VisualStudioUI Package Manager UI et al Priority:2 Issues for the current backlog. Product:VS.Client Type:Bug

Comments

@ZheeYoong1125
Copy link

ZheeYoong1125 commented Feb 28, 2025

NuGet Product Used

Visual Studio Package Management UI

Product Version

NuGet Client Dev\6.14.0.49

Worked before?

It is a regression since the issue reproes on D17.13\35825.156 with implicit NuGet 6.13.2.1, but doesn't repro on D16.11\35818.1 with implicit NuGet 5.11.6.4.

Impact

It bothers me. A fix would be nice

Notes:     

  1. The repro rate is 100%.   

  2. It doesn’t repro when installing the package with “Packages.config” format. 

  3. It doesn't repro when the package is first installed using the "PackageReference" format.

  4. The issue only repro when the package is first installed using the "packages.config" format and then uninstalled and reinstalled using the "PackageReference" format. 

Repro Steps & Context

  1. Create a C# Console App project (.NET Framework 4.8.1).

  2. Open Package Manager Settings dialog through menu Tools->NuGet Package Manager->Package Manager Settings. 

  3. Click the Package Sources tab, and add a custom feed source, type in the name is “Myget” and the package source is https://www.myget.org/F/andy-nuget-project/api/v2. 

  4. Check the “nuget.org” in Settings->NuGet Package Manager->Package Sources. 

  5. Check the “Prompt for format selection on first package install”, select “Packages.config” in the “Default package management format” drop-down list and click OK button. 

  6. Go back to PM UI -> Select the package source: “Myget” near the gear button.

  7. In the “Browse” tab, select a package and click the “Install” button.  

  8. After that, click the “Uninstall” button and click the “Install” button to install the package with “PackageReference” format.

  9. Observe the package source dropdown box.

Expected:  

The package source should be consistent with the one when installing the package. 

Image

Actual:  

After installing the package with “Package Reference” format, the package source will switch to different one as the record below.

Image

Verbose Logs

@kartheekp-ms kartheekp-ms added Functionality:VisualStudioUI Package Manager UI et al Area:Settings NuGet.Config and related issues Functionality:Install The install command in VS/nuget.exe and removed Triage:Untriaged labels Mar 6, 2025
@nkolev92 nkolev92 added Priority:2 Issues for the current backlog. Product:VS.Client labels Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area:Settings NuGet.Config and related issues Found:ManualTests Functionality:Install The install command in VS/nuget.exe Functionality:VisualStudioUI Package Manager UI et al Priority:2 Issues for the current backlog. Product:VS.Client Type:Bug
Projects
None yet
Development

No branches or pull requests

4 participants