Print Page | Close Window

TechTip: ContextSwitchDeadlock in Visual Studio 2005

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=119
Printed Date: 13-Apr-2025 at 5:42am


Topic: TechTip: ContextSwitchDeadlock in Visual Studio 2005
Posted By: IdeaBlade
Subject: TechTip: ContextSwitchDeadlock in Visual Studio 2005
Date Posted: 09-Jul-2007 at 12:23pm
http://rs6.net/tn.jsp?t=wefqa6bab.0.lirg6ubab.zufnlmbab.2355&ts=S0234&p=http%3A%2F%2Fwww.ideablade.com%2Ftech_tips_definitions.htm - Level 100
DevForce Express
http://rs6.net/tn.jsp?t=wefqa6bab.0.nblx5vbab.zufnlmbab.2355&ts=S0234&p=http%3A%2F%2Fwww.ideablade.com%2Ftechtips_summary.html - View Archived Tech Tips
http://rs6.net/tn.jsp?t=wefqa6bab.0.nblx5vbab.zufnlmbab.2355&ts=S0234&p=http%3A%2F%2Fwww.ideablade.com%2Ftechtips_summary.html">View%20all%20Tech%20Tips ContextSwitchDeadlock in Visual Studio 2005

Anyone who has been debugging within Visual Studio for any length of time has probably encountered the following message.

 

This is invariably very frustrating because it usually happens when you are deep in a debug trace and in order to continue debugging you need to restart the entire debug session. This is not always a simple process. More annoying is the fact that the error message is anything but helpful in determining what it is that you actually did wrong.

In fact, you didn’t do anything wrong. Visual Studio was just trying to help.

The following link describes the problem in some detail.

 
http://msdn2.microsoft.com/en-us/library/ms172233.aspx

There are several approaches that we have found to work around the problem. One simple but fairly severe approach is to execute a .reg file with the following contents.

 
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework]
"MDA"="0"

Another alternative is to go the menu in Visual Studio and uncheck the ContextSwitchDeadlock item.

Hopefully this will make debugging a slightly less painful experience.

 
Debug -> Exceptions -> Managed Debug Assistants



Print Page | Close Window