Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NuGet fails: "The underlying connection was closed: An unexpected error occurred on a send"

Tags:

nuget

I want to install Microsoft ASP.NET Identity Core through the use of Manage Nuget Packages, but when I click the install button the following error occurs:

The underlying connection was closed: An unexpected error occurred on a send

like image 614
Mohsen Avatar asked Dec 07 '13 19:12

Mohsen


People also ask

How do you fix the underlying connection was closed An unexpected error occurred on a send?

The underlying connection was closed: An unexpected error occurred on a send. This problem usually happens when the computer is using the Proxy/VPN. Please disable the Proxy/VPN temporary and try again.

How do I fix a missing NuGet package?

Quick solution for Visual Studio usersSelect the Tools > NuGet Package Manager > Package Manager Settings menu command. Set both options under Package Restore. Select OK. Build your project again.


2 Answers

Try pasting the following into a .reg file and run it. Then try running your NuGet command (no reboot required).

Windows Registry Editor Version 5.00  [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319] "SchUseStrongCrypto"=dword:00000001  [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.0.30319] "SchUseStrongCrypto"=dword:00000001 

Ran into this issue because TLS1.2 was not enabled (similar to Tony's response). Using http does not fix the situation because NuGet redirects to https now that TLS1.2 is enforced.

like image 131
neoscribe Avatar answered Oct 09 '22 07:10

neoscribe


This is SSL cert issue on http://go.microsoft.com. Change the package source url to http://packages.nuget.org/v1/FeedService.svc/ which works for me.

Source: https://github.com/nuget/home

like image 38
Ali Gol Gol Avatar answered Oct 09 '22 08:10

Ali Gol Gol