I\'ve tried every package I could possibly find and none of them will install in my project. I\'ve installed every update listed in the Extensions and Updates list that wer
In my case, nothing of the above helped. The root cause of the problem in my case was, that I uninstalled the package before and did not check in the change into source control (TFS in my case). After checking in the change (=the deletion of file in the packages folder), I could reinstall the package.
tl;dr - Delete this:
%AppData%/Nuget/Nuget.config
Warning: If you had custom NuGet sources, this will remove them, and you'll have to re-add them.
Longer version:
You might have corrupted your NuGet config. Oh no :(
Nuget.config is a file used to keep track of all of the places that NuGet pulls from, as well as configuring other things. More likely than not, this xml file got broken somehow.
C:\Users\{{username}}\AppData\Roaming\
Nuget.config
For reference: in the good days of 2017, your file should look something like this
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageRestore>
<add key="enabled" value="True" />
<add key="automatic" value="True" />
</packageRestore>
<activePackageSource>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
</activePackageSource>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="nuget.org" value="https://www.nuget.org/api/v2/" />
<!-- Others -->
</packageSources>
<packageSourceCredentials>
<!-- secret stuff -->
</packageSourceCredentials>
</configuration>
I found a solution for this in my case, try to update the NuGet Package Manager.
To do this:
This let me install packages without problem again.
Hope this helps!
In my case, there was an empty packages.config file in the soultion directory, after deleting this, update succeeded
Closing and re-opening VS2015 resolves the issue.
It seems that in some cases, simply reloading the affected project will work.
You need to Clear All NuGet Caches; for this you need go to Options and click on it like this: