Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NuGet can't find/download packages after upgrade to 3.4

I just updated to Visual Studio 2015 Update 2 from Update 1, and I also updated to NuGet 3.4. (The Update 2 release notes suggest this NuGet version corresponds to this Visual Studio update.)

After doing this, Visual Studio package restore is broken. When I try to download any NuGet package, I get an error like this:

An error occurred while trying to restore packages: Unable to find version '2.10.11' of package 'NPoco'.

like image 893
Sam Avatar asked Apr 04 '16 04:04

Sam


4 Answers

Problem occurred by me after the NuGet 3.4 update last week. Solution is to delete your 'NuGet.Config' file in '%AppData%\NuGet\', when you start VS2015 again it will create a new default config file.

NuGet settings with v3

Detailed instructions at: https://docs.nuget.org/Release-Notes/Known-Issues

Working config file:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
  </packageSources>
  <disabledPackageSources>
    <add key="Microsoft and .NET" value="true" />
  </disabledPackageSources>
</configuration>
like image 140
Jos Avatar answered Oct 18 '22 04:10

Jos


When I went into the NuGet settings, the package sources were unticked. Ticking the package source fixed the problem. I guess either the VS 2015 Update 2 installation or the NuGet 3.4 installation caused this to become unticked.

Ticketing the "Microsoft and .NET" package source under Settings -> NuGet Package Manager -> Package Sources

like image 25
Sam Avatar answered Oct 18 '22 03:10

Sam


Most likely the curated-feeds don't have that package. Try adding the uncurated-feed (https://www.nuget.org/api/v2).

like image 22
Casino Corley Avatar answered Oct 18 '22 03:10

Casino Corley


For me - I had to uncheck "show prereleases" - then my search returned to normal.

like image 1
FixinStuff Avatar answered Oct 18 '22 03:10

FixinStuff