Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I prevent the "... has stopped working" window on my Server 2008 R2 dev box?

I'm using a Windows Server 2008 x64 R2 machine as a development box. Amongst many other things I've got Visual Studio 2008 SP1 installed on it. When I'm working on a project, I sometimes need to use Debug > Start without Debugging (Ctrl + F5). If the program throws an exception, I get a new R2-style window appear. I'm pretty sure I didn't see this on my XP box - this is the first time I've developed directly on a server. Is there any way to avoid this - it's really beginning to bug me?

E.g. my current project is accessing a WCF service - I'm using Ctrl+F5 to start a console program client. I run it and get the window. The title is the name of the project I've just started and it contains:

[insert-project-name-here] has stopped working

Windows can check online for a solution to the problem.

--> Check online for a solution and close the program

--> Close the program

--> Debug the program

V  View problem details.

Clicking on "Close the program" will actually close the window and the exception message appears in the console, which is what I want (but without the extra window-faffing).

How can I avoid this annoyance?

like image 970
serialhobbyist Avatar asked Mar 24 '10 12:03

serialhobbyist


1 Answers

Just-In-Time Debugging on Windows Vista and 2008 Server

By default on Windows Vista, the just-in-time debugger is configured to display a user-friendly dialog shown below. Although you can click the Debug the program button and start the debugger successfully, your original Visual Studio instance will hang in the end of the debugging session.

In order to avoid having to constantly kill the Visual Studio process after debugging, you will want to change Just-In-Time debugger configuration to work the same way it does on Windows XP and Windows Server 2003. This configuration is stored in registry as DbgJITDebugLaunchSetting value in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft.NETFramework key. It’s default value on Windows Vista is 0×10. Change it to 0×2, which is the default value on Windows XP. After making this change, you should no longer see the User-Defined Breakpoint dialog and will be able to continue using Visual Studio after debugging.

from this page and scroll down to 'Just-In-Time Debugging on Windows Vista and 2008 Server'

Also note: if you are running x64 the key is going to be in the WOW section.

like image 113
Sky Sanders Avatar answered Sep 23 '22 20:09

Sky Sanders