Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2013 NuGet package management not working

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?

like image 371
osij2is Avatar asked May 01 '14 20:05

osij2is


People also ask

How do I enable NuGet package restore in Visual Studio 2013?

Restore packages manually using Visual Studio Enable package restore by choosing Tools > Options > NuGet Package Manager. Under Package Restore options, select Allow NuGet to download missing packages. In Solution Explorer, right click the solution and select Restore NuGet Packages.

How do I enable manage NuGet packages in Visual Studio?

Set up Visual Studio In Visual Studio, select Tools, and then select Options. Select NuGet Package Manager, and then select Package Sources. Enter the feed's Name and Source URL, and then select the green (+) sign to add a new package source. If you enabled upstream sources in your feed, clear the nuget.org checkbox.

How do I open the package manager console in Visual Studio 2013?

Open the project/solution in Visual Studio, and open the console using the Tools > NuGet Package Manager > Package Manager Console command.


2 Answers

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!

like image 120
JERKER Avatar answered Oct 14 '22 04:10

JERKER


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.

like image 29
Christopher Jordan Avatar answered Oct 14 '22 06:10

Christopher Jordan