install-package when there's no network connection hangs VS


from a customer...

I was on the bus this morning without internet access and (without thinking) typed Install-Package …

That ended up hanging VS for me and eventually caused a blue screen on my machine ;-)
I doubt the blue screen will be repro-able, but wanted to make sure we test the scenario and fail as early as we can


howarddierking wrote Mar 28, 2012 at 5:58 PM

one additional note - customer was running Visual Studio Web Express

JeffHandley wrote Apr 11, 2012 at 9:07 PM

@aldion - Can you find the repro pattern please?

aldion wrote May 16, 2012 at 6:31 PM

I found that it repros when going from an active internet connection to barely available but not when network is turned off or completely disconnected.

When the Network turned off / Not connected to any WIFI :
  • autocomplete doesn't work and doesn't hang
  • running commands fails right away. e.g. Install-Package : The remote name could not be resolved: 'nuget.org'
When the network is present but the connection doesn't work :
  • VS hangs and the task bar pop-ups a few times that VS is unresponsive.

johncrim wrote Apr 7, 2013 at 6:24 PM

I experienced similar problems this morning. It could be that the nugget repository web site is responding slowly; or perhaps our internal repository is responding slowly (less likely, as I pinged both).

I did not have no network connection - It could be that the nuget repository web site is responding slowly; or perhaps our internal repository is responding slowly. I tested both from a browser, and the nuget repository definitely was responding significantly slower.

I used procexp (from sysinternals) to determine that it was NuGet.exe, spawned from the msbuild, spawned from devenv.exe, that was causing the hang. VS became completely unresponsive until eventually it timed out. The bigger problem is that this seems to occur on project load and during build - if it only occurred when I launched the nuget manage dependencies dialog it would be less severe, as I could work around it with the command-line.

Also, it appears that "nuget install packages.config" keeps getting killed and restarted after a few seconds - which could be why the hang seems permanent.

johncrim wrote Apr 7, 2013 at 6:25 PM

I'm using VS 2012 Ultimate.

johncrim wrote Apr 8, 2013 at 12:53 AM

One more bit of data on the hang I was seeing - it may be related to a dependency on a non-existent nupkg. We expire old builds, and one of the dependencies had expired. But still, it was a severe hang.

I updated VS 2012 to update 2, and was still seeing it. There's a good case to be made that this is a VS bug if a delay in a build tool or a plugin makes the UI non-responsive.