简体   繁体   中英

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!

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.

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.

Do you have any nuget.config file in your Solution?

The format have changed from fx:

<settings>
  <repositoryPath>..\..\packages</repositoryPath>
</settings>

To:

<configuration>
  <config>
    <add key="repositoryPath" value="..\..\packages" />
  </config>
</configuration>

Could be some of your packages have been cached?

Download the latest nuget.exe (from https://dist.nuget.org/win-x86-commandline/latest/nuget.exe ) and open a command prompt ( preferably with administrator privileges ) and point to the location where you've download the nuget.exe and execute following commands (from command prompt or powershell console).

nuget.exe locals -clear global-packages
nuget.exe locals -clear http-cache
nuget.exe locals -clear temp

Then restart Visual Studio.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM