How it's possible that NuGet's Install-Package
fails with Unable to find version 'x' of package 'y'
when that exact version is released as NuGet to official repository and it shown on the https://www.nuget.org/packages/y page.
Here is specific sample with nuget.org content and NuGet Install-Package
command output.
UPDATE. Package sources are set to defaults (from nuget.org). Actually you can see the issue just running Install-Package Log4Net.Async -Version 1.3.0
.
UPDATE 2. I want to highlight that it's not about some developer's machine - the same things happening on Visual Studio Online Hosted Build Controller.
UPDATE 3. Here is how NuGet tries to load package and it looks like NuGet API just broken, because all these request fails with the error below.
Resource not found for the segment 'Packages'
Also NuGet produces the strange output on NuGet API calls that issues at VS search packages stage, please see here: http://pastebin.com/qveadrZB.
NuGet currently has some service issues related to search and package restore functionality. It is possible this is the cause of your package restore failure.
If other dev machines are working OK, it's likely they have access to a cached version of this package.
I know this thread is very old, but someone who has this problem like me in these days, find my solution for solving such problem here.
I've installed Visual Studio 2012/2015/2017 parallel, and 2012 failed with "package not found error". So I take a look in the NuGet-settings in VS2017 and found the following package resource:
I just added this location to the package resources and vòila, the searched packages where found and installed (in my example the HtmlRenderer).
But be careful with compatibility to Framework 2.0! This setting breaks maybe the functionality to version 2.0!!
Hope this helps someone sometimes somewhere.
Greetings
- Right click on references in your project
- Manage NuGet Packages => All
Uninstall affected packages
if this will not resolve the issue, try to remove it from NuGetConfigFile located at C:\Users\UserName\AppData\Roaming\NuGet\NuGet.config
I'm a latecomer to this thread... I'm in Visual Studio 2017 - 15.9.4
I got this error today trying to pull from my private DevOps NuGet feed
CONTEXT: the first time I called
Install-Package
everything worked, but, my NuGet was not assembled right, so, I re-published the NuGet pkg, and when I tried to update my project that was consuming the pkg, that's when I got the failure)
Switching my Package Source to "all" alleviated the problem.
来源:https://stackoverflow.com/questions/30464558/nuget-fails-to-find-existing-package