Visual Studio hangs on debug

So, I start our blog off with what will hopefully be a useful tip for anyone else who comes across this problem.

Certain projects within Visual Studio 2008 would not allow me to debug. I could attempt this either through pressing F5 or through attaching to the already running project via ctrl-alt-p, but the result would be the same – Visual Studio would hang. Killing the devenv process would be the inevitable next step.

I stumbled upon this solution when frantically trying to sort this out. Bingo!

Without wishing to tread on Sedge.Rev‘s toes, here is a step by step method to fix the problem.

  1. Using a text editor (Notepad, Context etc…) open the .csproj file for the offending web project and find the ProjectGuid node (around line 5).
  2. Generate a new guid – my preferred method is using command line sql (obviously only works if you’ve got SQL)
    sqlcmd -E -Q "select newid()"

    though I’ve just discovered this Online GUID Generator which will probably be where I get them from now.

  3. Search for the guid from step 1. and replace with the guid from step 2. in the .csproj and .sln files for that solution.

Open Visual Studio, load the project / solution and no more debug problems!

4 Responses to “Visual Studio hangs on debug”

  1. J says:

    Um – you are aware that a Guid tool ships with visual studio…Usually registered unter the tools menu, but if it’s not there it is still in the tools directory…(guidgen.exe)

  2. peter says:

    No I wasn’t but thank you for pointing that out.

  3. Steve says:

    Awesome. I had been struggling with this problem for ages, and this worked superbly.

Leave a Reply