14
votes

After updating Visual Studio to 2015 Update 2 I kept getting a "No packages found" error in NuGet Package Manager, despite browsing/searching for packages that I knew existed and which could be added from the Package Manager Console.

This is frustrating as the NuGet site clearly shows the packages are available. As a workaround I can install them via the Package Manager Console - but the GUI just shows "No packages found".

4

4 Answers

22
votes

As of VS2015 Update 2 the default and only feed installed is MS-Curated "Microsoft and .NET", https://www.nuget.org/api/v2/curated-feeds/microsoftdotnet/

This feed is missing a LOT of commonly used packages.

You can resolve this by simply adding the "normal" NuGet feed with all packages:

  1. Open Visual Studio 2015 as admin
  2. Tools > Options
  3. NuGet Package Manager > Package Sources
  4. Click the green "add" icon, and add the following feed:

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

14
votes

Here are the troubleshooting steps I would take when looking into this issue.

  1. Visual Studio Settings
    • Make sure you are in the BROWSE section.
    • Click on the Package Source drop down to the right.
      • Make sure nuget.org is listed.
        • If nuget.org is not listed, add it.
          • Open Tools > Options (Options window will open)
          • Locate NuGet Package Manager > Package Sources
          • Under available sources, click the + icon.
          • Enter NuGet.org as the package name
          • Enter https://api.nuget.org/v3/index.json as the package source.
          • Click the OK button to save changes.
      • **IMPORTANT** Choose ALL as your package source to search all sources.

enter image description here

  1. Connectivity & DNS

    • Make sure internet is connected
      • Open CMD
      • ping 8.8.8.8
        • If this does not respond your internet is not connected
      • ping api.nuget.org
        • If this does not resolve to an IP, then you have a DNS issue.
      • nslookup api.nuget.org 8.8.8.8
        • This should list the same IP address as the ping (along with some other info), If it does not then you may have a DNS issue (some local ISP DNS servers are not very good). Try changing your internet connection's DNS server to 8.8.8.8 and trying again.
  2. Proxy Issue

    • Do you have Fiddler open? This can interfere with your connection to the nuget repository. Try shutting it down.
    • Did you set all .NET to run through a proxy? This is a common step taken in troubleshooting if you need to see all requests coming in.
      • Open C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config
      • Remove or comment out the proxy configuration

Proxy Config Section

<system.net>
<defaultProxy enabled = "true" useDefaultCredentials = "true">
<proxy autoDetect="false" bypassonlocal="false" 
proxyaddress="http://127.0.0.1:8888" usesystemdefault="false" />
</defaultProxy>
</system.net>
4
votes

Another reason people may end up seeing "No package found" is that the UI defaults to "Installed" packages. Simply switch to the "Browse" tab, instead of the "Installed" tab.

enter image description here

3
votes

In my case I was looking for a prerelease and forgot to check Include prerelease