41

Strange issue I've had for the past few weeks. Running Windows 8 with Visual Studio 2013 Premium Ed. with Update 1. NuGet package manager within Visual Studio simply doesn't work. I've uninstalled/reinstalled it. I've updated my local NuGet.exe (was running 2.5, now 2.8.5) - made sure to include as a path variable. Even from the console, I can't install or update any packages. Console is confirmed running 2.8.50313.46.

From the manager, it simply loops the progress bar repeatedly displaying "Retrieving information..". Nothing displays for Updates or Online. From the Installed Packages, I can see everything within my solution with no problem.

enter image description here

Running as administrator as this post suggests for VS 2013 Express doesn't work either. Another post found it was a nuget.org issue, but in my case my colleagues can access nuget.org from within the package manager (same network) with no issues. Edit: I've also removed the suo files from my solution before opening it up on Visual Studio.

Any ideas on how to fix this?

Community
  • 1
  • 1
osij2is
  • 1,546
  • 3
  • 12
  • 21
  • 1
    Checking VS2013 logs would be one of the steps towards your solution, another step would be to check the extension and updates windows too see if nuget needs an update – csharpwinphonexaml May 01 '14 at 20:17
  • 1
    I see you have a couple of other Nuget package sources there. I've noticed the package manager will wait until it has data from all package sources before becoming available. Is it possible one of those other sources is taking a really long time to load? – Steven V May 01 '14 at 20:18
  • Good points. I'll try them both out and report. – osij2is May 01 '14 at 20:20
  • Disabled the other packages sources (nuget.org was only one active). No change. Will check VS2013 logs – osij2is May 01 '14 at 20:24
  • 1
    http://nuget.codeplex.com/workitem/3819 – David Brabant May 01 '14 at 20:26
  • I should've mentioned that I tried removing the suo files out of the solution before starting VS. Thanks for that though. I'll update my post to reflect that. – osij2is May 01 '14 at 20:43
  • I had same issue in visual studio express 2012 for web. For me it was package source problem, I checked the checkbox for nuget.org path, and then it work. – Sharifullah Sharif Mar 26 '17 at 02:46
  • Wrong TLS version? See answer below. – JERKER Aug 25 '20 at 08:31

14 Answers14

44

Seems like nuget.org removed support for default TLS version (1.1).

Run this command in NuGet command control (PM) to use version 1.2:

[Net.ServicePointManager]::SecurityProtocol=[Net.ServicePointManager]::SecurityProtocol-bOR [Net.SecurityProtocolType]::Tls12

However, it seems like a non-permanent solution, so after restarting Visual Studio, you need to run command again. Too bad.

Please notify if/when you find permanent solution!

JERKER
  • 907
  • 8
  • 17
  • Yes, this was the only solution that worked for me. And after some further research it was quite obvious that the main reason is the TLS version used – TLS 1.0 and TLS 1.1 are deprecated by all major browsers in 2020 and the nuget.org server is redirecting all http access to https and is requiring the TLS 1.2 protocol (as it should). So the solution is to make sure you have TLS 1.2 enabled in the registry and possibly disable the TLS 1.0 and TLS 1.1 protocols. Check the support pages at microsoft.com for info about the registry settings to enable TLS 1.2 – quite a few values to add/change… – Påhl Melin Aug 26 '20 at 20:19
  • 1
    E.g. one resource about enabling the TLS 1.2 protocol in the Windows registry: https://support.microsoft.com/en-us/help/3140245/update-to-enable-tls-1-1-and-tls-1-2-as-default-secure-protocols-in-wi – Påhl Melin Aug 26 '20 at 20:21
  • @PåhlMelin, Tack Påhl! – JERKER Aug 27 '20 at 13:03
38

I had the same issue. Uninstalling NuGet, restarting VS2013, then installing NuGet again worked for me.

You can do this in VS by going to Tools -> Extensions and Updates.

Owen Pauling
  • 11,349
  • 20
  • 53
  • 64
  • 1
    I do know this is not the "solution" to the problem but uninstalling and reinstalling nuget was a matter of seconds. For me the VS nuget manager now works flawlessly again. Thanks Christopher. – Simon Mattes Nov 17 '14 at 21:10
  • 1
    This may not have been the solution for some but it was mine! Nuget was automatically checking out every project in my solution on load and adding that true. Thank you! – Justin Mar 18 '15 at 23:15
  • 6
    this worked for me too, for people don't know how to uninstall nuget, go to Tools -> Extensions and Updates, you will find it there – uowzd01 Jun 18 '15 at 01:29
  • How to reinstall NuGet again? Any recommendations? – Leebeedev Mar 01 '21 at 18:53
  • 1
    This didn't work for me. https://stackoverflow.com/a/63574949/4100001 did. – Antonín Procházka Oct 07 '21 at 10:41
7

I have tried the other suggestions where they pertain to me (e.g. reinistalling package manager) but these didn't work. Strangely, just removing (unchecking) all package sources for Nuget Package Manager (Tools -> Options -> Nuget Package Manager -> Package Sources), clicking OK, then re-adding them fixed the problem.

For me when adding the nuget package manager new I added the following: https://www.nuget.org/api/v2/

Serg
  • 2,346
  • 3
  • 29
  • 38
Norman
  • 439
  • 3
  • 9
3

I had the same issue. Opening "Package Manager Console" (View->Other Windows->Package Manager Console) worked for me.

  • Adding in that this worked for me as well with no other changes. Simply opened the Package Manager Console and then the Manage NuGet Packages window > Online started showing all packages and allowed searching. This is on VS 2013 update 5. – FreeMars Mar 22 '23 at 18:34
2

I had the same issue, and it was related to proxy settings behind my companies firewall.

You can find the file C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe.config

VS update 4 seemed to remove them, not sure why. Further details here: Visual Studio 2013 Update 4 - Tools and Extensions Not reaching the internet

Community
  • 1
  • 1
blomster
  • 768
  • 2
  • 10
  • 27
  • I wish I had seen this earlier. It would not surprise me if this worked. Unfortunately, I had rebuilt my laptop so it no longer was an issue, but the proxy issue could explain the problem I had. :) +1 – osij2is Feb 22 '15 at 21:42
2

As described on the 'Deprecating TLS 1.0 and 1.1 on NuGet.org' page.

https://devblogs.microsoft.com/nuget/deprecating-tls-1-0-and-1-1-on-nuget-org/

I've added the following 2 entries to the registry and the nuget package manager started working again:

reg add HKLM\SOFTWARE\Microsoft\.NETFramework\v4.0.30319 /v SystemDefaultTlsVersions /t REG_DWORD /d 1 /f /reg:64
reg add HKLM\SOFTWARE\Microsoft\.NETFramework\v4.0.30319 /v SystemDefaultTlsVersions /t REG_DWORD /d 1 /f /reg:32
Koen M
  • 21
  • 1
1

I had the same experience and mine was due to the fact that I was running a http debugger(fiddler) at the time. I killed the fiddler and restart the Visual Studio and it worked.

mike_jik
  • 63
  • 1
  • 8
1

Please take a look at NuGet Behind Proxy.

In few words you should put

<configuration>
    <config>
        <add key="http_proxy" value="http://my.proxy.address:port" />
        <add key="http_proxy.user" value="mydomain\myUserName" />
        <add key="http_proxy.password" value="base64encodedHopefullyEncryptedPassword" />
    </config>
</configuration>

to NuGet.config that could be found at c:\Users\<your name>\AppData\Roaming\NuGet\ (or current .nuget dir, see http://skolima.blogspot.ru/2012/07/nuget-proxy-settings.html).

This can be done by running the following commands:

nuget.exe config -set http_proxy=http://my.proxy.address:port
nuget.exe config -set http_proxy.user=mydomain\myUserName
nuget.exe config -set http_proxy.password=mySuperSecretPassword

against c:\Users\<your name>\AppData\Roaming\NuGet\NuGet.exe

Actually only password should be set via command, other parameters you can just put into file. Also you can ommit passw, then nuget will ask you when needed.

Community
  • 1
  • 1
1

TOOLS --> nuGet Package Manager --> Package Manager Console

then copy that [Net.ServicePointManager]::SecurityProtocol=[Net.ServicePointManager]::SecurityProtocol-bOR [Net.SecurityProtocolType]::Tls12

press enter.

try again, it works

yoduh
  • 7,074
  • 2
  • 11
  • 21
0

This happened to me when I added a NuGet v3 custom repository URL to 2013 (which I guess uses v2).

Once I had configured it to use the v2 URL I was good to go.

Langdon
  • 19,875
  • 18
  • 88
  • 107
0

I had the same problem and I found a solution that fixed the issue. If no Windows http proxy is specified, then Nuget uses the environnement variable http_proxy.

If you want to know your proxy settings, open a prompt as administrator and hit this command:

netsh winhttp show proxy

Source: Show proxy setting

  1. Control Panel -> Advanced system settings -> Environment Variables

  2. Find http_proxy and delete it.

  3. Open Visual Studio and TOOLS -> NuGet Packages Manager -> NuGet Package Manager for solution...

  4. Select Online on the left side and you will finally see the online list.

Source post: Unable to load the service index for source (bad proxy settings)

BIBD
  • 15,107
  • 25
  • 85
  • 137
Gianni P.
  • 11
  • 1
0

In my case, i had a couple of other NuGet package sources there with nuget.org, I have just removed other than nuget.org. by clicking setting on left down corner and unchecked all except nuget.org and now it is working fine.

raviook
  • 99
  • 1
  • 5
0

https://devblogs.microsoft.com/nuget/deprecating-tls-1-0-and-1-1-on-nuget-org/

Open command prompt as administrator in windows 10

Run following commands

reg add "HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client" /v DisabledByDefault /t REG_DWORD /d 0 /f /reg:32
reg add "HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client" /v DisabledByDefault /t REG_DWORD /d 0 /f /reg:64
reg add "HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client" /v Enabled /t REG_DWORD /d 1 /f /reg:32
reg add "HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client" /v Enabled /t REG_DWORD /d 1 /f /reg:64

Nuget will start working

Shivam Srivastava
  • 4,496
  • 2
  • 23
  • 24
0

First, run this in the package manager console.

[Net.ServicePointManager]::SecurityProtocol=[Net.ServicePointManager]::SecurityProtocol-bOR [Net.SecurityProtocolType]::Tls12

Now try this version:

NuGet\Install-Package AjaxControlToolkit -Version 20.1.0
fatihyildizhan
  • 8,614
  • 7
  • 64
  • 88