Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NuGet fails to find existing package

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 the 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.

nuget package snapshot

install package failure

UPDATE. Package sources are set to defaults (from nuget.org). Actually, you can see the issue just by running Install-Package Log4Net.Async -Version 1.3.0.

package sources

UPDATE 2. I want to highlight that it's not about some developer's machine - the same things happen 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 requests fail with the error below.

install-package intercepted http requests

Resource not found for the segment 'Packages'

Also NuGet produces a strange output on NuGet API calls that issued at VS search packages stage, please see here: http://pastebin.com/qveadrZB.

like image 562
Eugene D. Gubenkov Avatar asked May 26 '15 16:05

Eugene D. Gubenkov


People also ask

How do I force a NuGet package to reinstall?

Switch to the Browse tab, search for the package name, select it, then select Install). For all packages, delete the package folder, then run nuget install . For a single package, delete the package folder and use nuget install <id> to reinstall the same one.

How do I restore references in Visual Studio?

Go at References in visual studio and look at which packages are missing. Now right click on Solution in Visual and click on open folder in file explorer. Now open packages folder and delete missing packages folder. Open visual studio and just build the solution.


1 Answers

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.

Screenshot of status.nuget.org on 26 May

like image 136
Matt Brooks Avatar answered Sep 22 '22 02:09

Matt Brooks