Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nuget package sources not being saved

My NuGet package manager cannot save new or find existing package sources.

The location where the package sources are saved %appdata%\NuGet\nuget.config is not getting updated since the problem started. Deleting it does not re-create it when I try adding a new package source through the Visual Studio -> Package Manager Sources dialog.

"Package Manager sources" dialog always shows empty on trying to save something and re-opening the dialog.

This problem started on my laptop after changing my corporate password from my office desktop computer (which does not have this issue).

Re-installing "Nuget Package Manager" did not help. Re-installing Visual Studio did not help.

like image 412
Tushar B Avatar asked Sep 04 '15 23:09

Tushar B


People also ask

Where are NuGet package sources stored?

The location of the default global packages folder. The default is %userprofile%\. nuget\packages (Windows) or ~/. nuget/packages (Mac/Linux).

How do I set NuGet package source in Visual Studio?

Set up Visual StudioIn Visual Studio, select Tools, and then select Options. Select NuGet Package Manager, and then select Package Sources. Enter the feed's Name and Source URL, and then select the green (+) sign to add a new package source.

Where is package config?

If used, packages. config must be located in a project root. It's automatically created when the first NuGet operation is run, but can also be created manually before running any commands such as nuget restore . Projects that use PackageReference do not use packages.


1 Answers

My problem is fixed :)

The step of deleting %appdata%\NuGet\nuget.config may have helped along with other steps.

Restarting Visual Studio re-generated this file with nuget.org package source added. I am almost sure I had tried this before but it had not worked before. The only other major difference was that I was not connected to corporate VPN network when restarting Visual Studio.

After searching everywhere, doesn't look like anyone has faced (or at-least asked) this issue. Hope this posting helps someone in the future.

like image 153
Tushar B Avatar answered Oct 04 '22 00:10

Tushar B