NuGet unable to find the version of a package

It turns out simply updating the NuGet version via

nuget.exe update -self

to update from 2.8.0 to 3.4.4 was sufficient, and the package now restores correctly.


I was able to resolve this on macOS using the following command to reset my NuGet caches / indexes:

dotnet nuget locals --clear all

Afterwards I was able to restore my packages successfully:

dotnet restore

I had the same problem, but I needed to stay with nuget.exe 2.8 due to not being able to upgrade the version of .NET Framework installed on our build server (2.8 is the last version that still works with .NET 4.0).

The cause turned out to be having nuget.config only pointing to the v3 API. The solution is to add in the v2 API. For example,

<configuration>
  <activePackageSource>
    <add key="All" value="(Aggregate source)" />
  </activePackageSource>
  <packageSources>
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
    <add key="nuget v2" value="https://www.nuget.org/api/v2" />
  </packageSources>
</configuration>

Tags:

.Net

Nuget