NuGet Package Manager: "No packages found" even though the package exists - visual-studio

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

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:
Open Visual Studio 2015 as admin
Tools > Options
NuGet Package Manager > Package Sources
Click the green "add" icon, and add the following feed:
NuGet: https://api.nuget.org/v3/index.json

Here are the troubleshooting steps I would take when looking into this issue.
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.
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.
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>

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.

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

Related

Issues connecting to Nuget. Cannot turn off proxy

In Visual Studio 2017 I'm trying to connect to the nuget server to update some stuff, but I'm getting this error:
[nuget.org] Unable to load the service index for source https://api.nuget.org/v3/index.json.
An error occurred while sending the request.
Unable to connect to the remote server
My work PC is behind some proxy because in Connections > Lan Settings > Use Automatic Configuration Script, there's this address: http://autoproxy.SomeDomain.com/autoproxy.cgi
If I uncheck this, I won't have access to the internet.
The odd thing is that I can see the contents of https://api.nuget.org/v3/index.json in a browse, but VS2017 cannot connect to it.
What alternatives do I have? Can I download the nuget package manually and just update using VS2017?
What alternatives do I have? Can I download the nuget package manually and just update using VS2017?
To resolve this issue, you can try to add proxy settings into Nuget.Config file which store in C:\Users\<user name>\AppData\Roaming\NuGet.
Refer to this link for details: Nuget Config Section & Nuget Proxy Settings.
Besides, if above not help you. Since you can access the contents of https://api.nuget.org/v3/index.json in a browse, you can create a local feed for those packages, so that you can save the downloaded the nuget package and just update using VS2017.
How to create you local feed and how to use the local feed, please check the details from my another answer.
Hope this helps.
Open the Windows "Proxy Settings" and verify that the proxy settings are set to automatic or if you use a .dat configuration that it is valid and not cached (somehow).
If none works try explicitly setting a new and valid proxy in the nuget.config file to force it going to the one you know that works.

Only one package appearing in NuGet Package Manager Browse tab

The company I work at keeps all of its NuGet packages in a shared network folder which is referenced in the NuGet Settings, while all of the NuGet packages are visible in the folder, only one would appear in NuGet Package Manager under the browse tab. I am not using a filter or search either, so I'm unsure why this is happening. Interestingly, the package which is showing is the most recently updated package available.
I am running Visual Studio 2017 Enterprise in Administrator on Windows 8.1.
Has anyone else had this issue? How would I solve it?
Has anyone else had this issue? How would I solve it?
Just as imps comment. You should make sure the checkbox "Include prerelease" is checked and the package source "shared network folder" is selected:
If you have already done that, please double check if the package source is correct or you can share us some screenshots of this issue so that we can read this question more intuitive.

Published NuGet packages not showing in remote NuGet Feed?

I am setting up a NuGet server to host our packages internally. I followed the steps listed below:
https://docs.nuget.org/create/hosting-your-own-nuget-feeds
but having issues.
I have a site setup in IIS on the TFS server and can navigate to the URL successfully. I see the "You are running NuGet Server 2.8.5 but the link to view your packages doesn't show any packages. However, I can publish packages successfully from the visual studio project to the remote package path which is the normal inetpub\wwwroot etc. The packages show up in the path correctly and also show up in visual studio in manage packages menu. Anyone have an idea why they aren't showing up in the package feed URL?
I would greatly appreciate any help I could get.
Thanks,
I was having similar issues. I was able to get it working by using the full file path in packagesPath key of the web.config. I could not use a relative path.

NuGet Package manager stuck on "Retrieving information..." on VS 2013

Using VS 2013 with NuGet Package Manager installed, I can view all Installed packages, but when I pick Updates or Online, I get an endless busy indicator showing "Retrieving information..."
I've verified I have a good connection. I uninstalled/reinstalled NuGet Package Manager.
Any other suggestions?
Thanks
I'm using VS 2013 and all of suggested solutions has failed.
I solved the problem by applying the following method :
Open package manager console in Visual Studio
Type: [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bOR [Net.SecurityProtocolType]::Tls12
This will change the connection security protocol to nuget as specified in this article: Deprecating TLS 1.0 and 1.1 on NuGet.org
May be it will help someone. My problem was with Nuget Package Manager. I've just updated its version.
To update Nuget Package Manager you need go to the menu under Tools -> Extensions and Updates -> Updates tab -> Visual Studio Gallery.
I encountered the same problem and tried different solutions but none worked! So I am using this workaround.
Go to https://www.nuget.org
Search for the package you want to install, it would show you the command for installing the package.
Open package manager console in VS and run the command (make sure you select the right project). This will install the package for you.
Cheers.
For me it was a problem with NuGet not Visual Studio. The problem turns out to be that NuGet does not like proxy settings of any kind. Running a local proxy debugging tool such as Fiddler will break NuGet! You’ll need to turn them off or uninstall them also ensure that the environment variable HTTP_PROXY is removed from your system settings. Also you will need to check your system proxy settings as well and make sure you are not using a proxy.
This has been documented else where and is the problem for a lot of folks out there!
The following steps should help:
Open the nuget website
You can select any package but I would suggest EntityFramework
Open your project then select Tools > library package manager > package manager console
paste this into the console: Install-Package EntityFramework -Version 6.4.4
After taking these steps your nuget will work but only for the current project.
there is some error in NuGet package manager in VS 2013. It's noticed and fixed by Microsoft, but we are waiting for new update of NuGet.
But there is some more reasons, why you stuck on "Retrieving information". First check your proxy and firewall settings. In my situation, we need to unblock something(it is in my work, so I don't know,what exactly) and after that I saw the updates.
I've noticed this problem once I changed versions of Visual Studio. For whatever reason, the Nuget extension breaks during the installation process even though it seems to be installed in Visual Studio. You basically need to reinstall Nuget, and I had to follow the instructions on this link to get things working again:
http://www.paraesthesia.com/archive/2013/07/30/upgrading-nuget-the-process-cannot-access-the-file-because-it.aspx/
I came across this problem and it would hang for about an hour at times. How I get round it is go to download a package in the Manage Nuget packager and then right click on your project and click clean. The download pops up within 2 -20 seconds.
Open packet manager console in Visual Studio
Type: [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bOR [Net.SecurityProtocolType]::Tls12
its solve my issue.
Open package manager console in Visual Studio
Type: [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bOR [Net.SecurityProtocolType]::Tls12
It works well
I faced the same issue, tried different solutions but was unable to resolve the issue. Finally, I tried this method and resolve my problem.
Go to the NuGet website: https://www.nuget.org/
Copy the EntityFramework Package link (Latest Version Suggested)
Go to your project in Visual Studio > Tools > NuGet Package Manager > Package Manager Console
Paste copied link into the console and download

Nuget - Don't see allow nuget to download missing packages during build

I get a message saying the following:
Error 1 Package restore is disabled by default. To give consent, open
the Visual Studio Options dialog, click on Package Manager node and
check 'Allow NuGet to download missing packages during build.' You can
also give consent by setting the environment variable
'EnableNuGetPackageRestore' to 'true'.
When I go to Tools -> Options, I do not see Package Manager and underneath I see Package Sources and Recent Packages. I do not see anywhere where I can set Allow Nuget to download missing packages during build though.
The option to give consent in the UI has been added with NuGet Package Manager 1.8. It's the 3rd item under Tools-> Options-> Package Manager-> General : "Package Restore : Allow NuGet to download missing packages during build".
Please make sure NuGet is up-to-date in Tools->Extension Manager.
Alternatively you can give consent by setting the EnableNuGetPackageRestore Environment variable to true.
I found I needed an extra couple of steps to get it to download the packages
Check Allow NuGet to download missing packages during build
Check Always show solution in Projects and Solutions
Right click on solution and Enable NuGet Package Restore
Open Manage NuGet Packages and click Restore
I did not seem to have the "Package Manager" node under Tools->Options [this was in Visual Studio 2013 :-)]. To get that node in there, I browsed to Tools -> Extensions and Updates and searched for nuget. Installing "NuGet for Visual Studio 2013" got me the node and the option to allow package restore!
I am using Visual Studio 2010 and NuGet 2.0.
Someone had checked in a solution that used NuGet for various packages. When I checked out the solution and built it, I got the same errors. What's more, when I viewed the NuGet Package Manager from the Tools -> Options window, the Package Restore already had the appropriate check boxes checked.
I tried clicking the Clear Package Cache button. After doing that, everything built correctly.

Resources