Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NuGet Package Not working in Visual Studio 2015

After updating Visual studio 2015, I am getting the following error when visual studio starts. Nuget Operation failed NuGet.Config is not a valid XML. Path

'.' hexadecimal value 0x00, is an invalid character. Line 1, Position 1.

Also, i cannot use the package manager console anymore.

I tried uninstalling and reinstalling it, but with no success. i am still getting the error above.

Any guidance on how to fix this would be appreciated, thanks!

like image 789
Sal Avatar asked Apr 21 '16 05:04

Sal


People also ask

How do I enable NuGet package restore in Visual Studio 2015?

To do that, go to Tools, NuGet Packaged Manager, then go to Package Manager Settings. Go to the General section, and then make sure you have a checkmark for Allow NuGet to download missing packages and also to automatically check for missing packages during the build in Visual Studio. So click on OK.

How do I install NuGet packages in Visual Studio 2015?

From Visual Studio, select Tools > NuGet Package Manager > Package Manager Console. After the Package Manager Console pane opens, verify that the Default project drop-down list shows the project in which you want to install the package.

How do I fix a missing NuGet package?

Quick solution for Visual Studio usersSelect the Tools > NuGet Package Manager > Package Manager Settings menu command. Set both options under Package Restore. Select OK. Build your project again.

How do I enable manage NuGet packages in Visual Studio?

To find and install a NuGet package with Visual Studio, follow these steps: Load a project in Solution Explorer, and then select Project > Manage NuGet Packages. The NuGet Package Manager window opens. Select the Browse tab to display packages by popularity from the currently selected source (see Package sources).


2 Answers

Delete NuGet.Config from:

C:\Users\your-username\AppData\Roaming\NuGet

Upon re-opening VS2015 a new config file will be created and the issue should be resolved.

like image 133
Chawin Avatar answered Oct 20 '22 00:10

Chawin


Delete ".nuget" folder from C drive\users\username

C:\Users\{username}\.nuget

and you can update or re-install the package.

This is work for me.

like image 25
Sadik Ali Avatar answered Oct 20 '22 00:10

Sadik Ali