VS2015 nuget package manager not finding packages

I installed VS2015 Update 2 and now nuget package manager does not find any packages outside of the "Microsoft and .net" package source. It looks like the nuget package source was removed. When I add it back as "http://www.nuget.org" I get an error "Unable to retrieve results from one or more sources".

Anyone else having this problem?


Solution 1:

This is a known issue with nuget version 3.4, which is included with Visual Studio 2015 Update 2:

The NuGet.config file in your %AppData%\NuGet\ folder has accidentally been emptied. To fix this: Close Visual Studio 2015, delete the NuGet.config file in the %AppData%\NuGet\ folder and restart Visual Studio. A new NuGet.Config file will be generated and you will be able to proceed.

Solution 2:

The nuget.org package source is still there after the upgrade for me. But if it ever disappears you can add it back as:

Name: nuget.org

Source: https://api.nuget.org/v3/index.json

Solution 3:

I am using Visual Studio 2015 Update 2 and had the Original Poster's issue. My package source config file was not deleted but the nuget source was set to https://api.nuget.org/v3/index.json. I had to manually open the config file and change the URL to http://api.nuget.org/v3/index.json in order to get packages to appear. However, I got errors when attempting to download the package I needed. So finally I checked for updates, saw Visual Studio 2015 Update 3, installed it, and now I can finally see the packages, download and install them (using the http address - the https did not work)!

Solution 4:

After Upgrading Visual Studio 2015 in September 16, my NuGet.config had been renamed as NuGet_temp.config. I deleted the NuGet.config file and renamed the _temp version as NuGet.Config.

After that all of my packages are showing again.

Solution 5:

For me it was a genuine temporary network problem. IVe tried again a bit later, and the error disappeared.