Reputation: 8209
Been getting the error for two days now:
PM> install-package routedebugger
Install-Package : The underlying connection was closed: An unexpected error occurred on a send. At line:1 char:16 + install-package <<<< routedebugger + CategoryInfo : NotSpecified: (:) [Install-Package], WebException + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand
I'm getting this error on quite a few packages (modernizr) but some install fine like Dapper. I found this post and tried to change my nuget feed but the same thing still happens. I have nuget 1.8.30524.9000. Any Ideas?
Update: I decided to try to on a couple different machines just to make sure something wasn't messed up with my install of visual studio 2010. They all failed. That led me to believe maybe it was the internet. We recently upgrade our websense. I gave the web admin the nuget feed urls and he said they weren't blocked. So i went to my own personal labtop which i can tether through my Ipad and everything worked perfectly. I tried to use fiddler to try to monitor nuget but apparently that doesn't work even when the feed is http. Any idea how i can diagnose whats going on? Whats wierd is some packages install just fine.
Upvotes: 6
Views: 10493
Reputation: 3234
I was getting this error in command window with
nuget update -self
error:
The underlying connection was closed: An unexpected error occurred on a send.
I simply downloaded and replaced nuget.exe from https://www.nuget.org/downloads
(used this build: nuget.exe v5.7.0) it resolved.
Upvotes: 0
Reputation: 12198
I ran into the same issue, reinstalling nuget was the solution for me.
Upvotes: 0
Reputation: 8209
I was able to figure it out using wireshark. Not sure why i was wasn't able to see the traffic with fiddler (with https proxy setup for all proceses) but anyways it was trying to download the package from: https://nugetgallery.blob.core.windows.net/packages/Modernizr.2.5.3.nupkg
which was being blocked by websense. Admin opened it up and now everything is working. I'm assuming the URL for some packages are different (like dapper) which was able to download successfully.
Upvotes: 4