Visual Studio 2013 - Error occurred while trying to restore packages. The underlying connection was closed.

StackOverflow https://stackoverflow.com/questions/19643958

In Visual Studio 2013, NuGet package manager fails to restore packages. When clicking Manage NuGet Packages on the project, NuGet states "Some NuGet packages are missing from this solution. Click to restore from your online package sources.". After clicking "Restore", the following error appears...

Manage NuGet Packages Window

Error occurred while trying to restore packages. The underlying connection was closed.

If you build the project, the output window shows the following errors...

Build Output Window

Restoring NuGet packages...
To prevent NuGet from restoring packages during build, open the Visual Studio Options dialog, click on the Package Manager node and uncheck 'Allow NuGet to download missing packages during build.'
NuGet Package restore failed for project MyProject: The underlying connection was closed: An unexpected error occurred on a send..
NuGet package restore failed.

Any ideas?

有帮助吗?

解决方案

This turned out to be an issue with the CDN host that Microsoft was using didn't have SSL enabled. Trying to access the CDN URL for the RazorGenerator.MVC package was failing. If I changed the response returned to non-SSL via Fiddler it worked just fine.

It seems Microsoft just fixed their CDN issue - case closed.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top