Debugger.Launch() is now crashing my .NET application after upgrading to .NET 4.0 - by markoueis

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 611486 Comments
Status Closed Workarounds
Type Bug Repros 7
Opened 10/7/2010 10:23:43 AM
Access Restriction Public


For debugging environments, we have a conditional Debugger.Launch statement in the code to allow developers to debug into the startup code of the windows service. We just upgraded to .NET 4.0. Since the upgrade, if we exit out of the JIT window (i.e. we chose not to debug), the Windows Service crashes (process is terminating). It used to simply resume. If we accept to attach, the application does not terminate and works fine.

Another strange thing is that the exception that is thrown is no longer a Launch for User exception. It is now an unhandled Microsoft .NET framework exception. I've tried to wrap a try catch arround it to see what i get. I can't catch the exception when i'm debugged in because at that point the exception doesn't occur. If i try to log the exception to a file, the Service crashes and i get nothing.

This is apparently pretty easy to reproduce. It has occured on multiple systems in house and I've received confirmation from an external party that the problem can be reproduced simply by using the code snippet above in a .NET windows form that uses .NET 4.0
Sign in to post a comment.
Posted by Microsoft on 5/25/2012 at 12:35 PM
Thank you for submitting this report. While, unfortunately, this issue did not meet the bar for Visual Studio 2010 SP1, we are glad to report that the fix has been included in Visual Studio 11, and has already shipped with the Developer Preview.
Posted by JeffN825 on 10/18/2011 at 12:38 PM
Shameful Microsoft, simply shameful.
Posted by markoueis on 3/9/2011 at 10:08 AM
Did this make Visual Studio 2010 SP1? If not, do we have an idea when microsoft plans on fixing it. Is there a hotfix for this yet?

Posted by Microsoft on 10/15/2010 at 10:15 AM

We have been able to repro the issue. We will continue our investigation to see how best to fix it and then make it available.

For a workaround instead of calling Debugger.Launch() you could call something like MessageBox.Show("Attach a debugger now if you want to") similar to what repro does. When the message box pops up you can manually attach to the process using Tools -> Attach to Process OR continue the process by clicking on OK button. I realize this is not as convenient.

Hope that helps.

Azeem Khan
VS Debugger.
Posted by Microsoft on 10/10/2010 at 11:46 PM
Thanks for your feedback.

We are rerouting this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.

Posted by markoueis on 10/8/2010 at 7:33 AM
I've also attached the VS 2010 solution that causes this problem. It's attached to this case
Posted by markoueis on 10/8/2010 at 7:31 AM
I have posted a dump file created using procdump.exe.
Posted by Microsoft on 10/7/2010 at 6:50 PM

Thanks for reporting the issue.
In order to fix the issue, we must first reproduce the issue in our labs. We are unable to reproduce the issue with the steps you provided.
It may help if you provide us with a dump file and call stack.

You can get detailed steps about how to get the dump file and call stack at

Or you can download a Visual Studio 2010 Diagnostic Tool from You can get detailed description about how to use it to collect dump file.

Please zip the file and use "FeedbackID-611486" as prefix of the file name.

You can use the following workspace to upload the file:
Password is 9f]XUpR2Vq

Thanks again for your efforts and we look forward to hearing from you.
Microsoft Visual Studio Connect Support Team
Posted by Microsoft on 10/7/2010 at 11:23 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(