When I add a NuGet package (latest version of NuGet and Visual Studio 2015) it hangs at "Attempting to gather dependencies" for ~5 minutes before installing the package. I can point to NuGet.org, our internal server, or a folder on my local machine. All behave exactly the same.
6 Answers
After a lot of digging (I had this issue for a long time before posting) I found the issue. One of the NuGet package sources in my list was down. If I remove that from the list, everything goes smoothly. With it in, it bogs down even if no packages in my packages.config are related to that source.

- 3,471
- 3
- 23
- 34
-
7Semi-related: Happens on bad connections as well. I left it for a few minutes, and it eventually went through. Might be useful to future readers if they only have the official nuget repo – Rob Apr 12 '16 at 11:21
-
In my case, the other package source was not really down, as it was responding. However turning off all sources besides nuget.org, fixed the problem for me. – Paweł Forys Feb 14 '17 at 11:07
-
1We're running an internal NuGet server for a customer, which is behind a VPN. I'd forgotten to turn on the VPN. As soon as I did, the package downloaded just fine (even though it was from the official NuGet servers and had nothing to do with our internal server). – HenricF Apr 10 '17 at 06:19
I struggled with the same issue for too long and almost all the advice I read was to update nuget VS extension (I'm using VS package manager console) or restart VS and nothing worked...
My setup (at time of issue):
- VS 2015 Pro Update 2
- Package Manager Console Host Version 3.4.3.855
Solution that finally worked for me:
- Close VS if open.
- Delete %AppData%\NuGet\NuGet.Config
- Open VS and package manager console (this will recreate Nuget.config)
This updated my nuget.org feed to no longer point to www.nuget.org/api/v2 (see image below)
After this installing packages no longer hung on 'Attempting to gather dependency information for package...'
Kudos to https://stackoverflow.com/a/36461793/4977243 for the idea of deleting nuget.config.

- 1
- 1

- 2,550
- 18
- 17
-
Wowww! This has been driving me crazy during 2 hours. Thank you man! – fabriciorissetto May 26 '16 at 23:15
-
Awesome !!! This was really a pain. Removing the Nuget v2 feeds was the key – Seb T. Dec 09 '16 at 15:46
This morning, all of our builds started failing. After doing some digging, we figured out that it was hanging on https://www.nuget.org/api/v2 while resolving dependencies. More digging, it was connecting and downloading but seemed to be caught in a loop. Each time we cancelled the build, it left a Nuget.exe running in the background - CPU got hot.
Turns out that nuget.org upgraded their servers last night (1/13/2016) and the version of Nuget.exe that our builds were running (2.7.2) was choking.
The fix (at least for us) was to upgrade to 2.8.6 (https://dist.nuget.org/win-x86-commandline/v2.8.6/nuget.exe). I know that isn't the most current version but it worked for us. We'll upgrade later after the smoke dissipates!

- 2,203
- 1
- 21
- 18
- Please go to the location of Nuget.config in Windows machine (of user) %appdata%\NuGet.
- Here you can remove the key(s) of the incorrect package's location(s)/link(s).
- Now try the same command in SHELL to download package.

- 848
- 10
- 15
For me, it has always been a wrongly configured proxy issue. When the error says: "Gathering dependencies....", its usually trying to download some package.
If all the nuget configurations are right, please do check the system proxy.

- 140
- 1
- 8
My issue is the Nuget Packages folder doesn't exist. I have renamed my local folder name from "packages" to "NugetPackages". Checking the contents of the csproj file is worth a try.

- 497
- 2
- 8
- 18