I was talking to John Robbins about debugging .NET applications today during lunch at Devscovery. He answered a question I had about the infamous ‘CLR has been unable to transition from COM context … for 60 seconds’ error.
This occurs for me when using a Debugger.Break statement in my Winform code while demonstrating examples during a workshop. One fix for the problem is to go to the Debug -> Exceptions -> Managed Debug Assistants menu in Visual Studio and uncheck the ContextSwitchDeadlock
I already knew about this Managed Debugging Assistants checkbox and had unchecked it in the past. The big revelation for me was that this setting is saved in the abc.suo file and is not a global Visual Studio setting. That means I have to remember to change this for every project I use in my classes!

What I can find Debug -> Exceptions -> Managed Debug Assistants menu ?
I use vs.net 2005 professional version, and can’t find Exceptions.
Thanks
tony …..
try Ctrl + Alt + E
This just hides the symptom. You are basically ignoring the exception.
I would like to know what the cause for this deadlock exception.
What the Managed Debugging Assistant (MDA) Context Switch Deadlock is reporting is that an STA COM thread has not responded to a message in 60 seconds.
If you’ll remember, Single Threaded Apartment COM is done through message passing. This exception does not occur unless that MDA is turned on, which it is by default when running under a debugger.
Since so many VB6 COM components are only STA and the main thread in Windows Forms is STA, it’s a warning that you’re blocking. If you run into a deadlock outside the debugger, it becomes your ordinary deadlock analysis.
- from John Robbins
its good, i have lot help for thi site
I had the same problem as you. I could solve it with following code:
Application.DoEvents();
when you do a loop in a method which takes longer as 60 seconds, the debugger will raise an error..
while(true)
{
//TODO: break; sometime!
…
Application.DoEvents();
}
This page is very helpful for me.
i unchecked context switch deadlock and trace line of error then find the solution. thax
Thanks !! dude … !!
This page was very useful for me.Thanks
Thanks a lot,
It’s very helpful,
good luck
thanks it was very helpful tip
Thanks its solve my Problem
Again Thanks Lot
Afroz
Thanks mate! It solved my problem as well..
great..it works fom me too..thanks!
Thanks
Thanks for g8t post. helped me a lot. thankssssssssssssss
[...] http://blog.wpfwonderland.com/2007/08/16/clr-has-been-unable-to-transition-from-com-context-for-60-s... [...]
it works, it don’t show exception up. but the application runs slowly in the point.
So i think simply uncheck it,not the way.
Thanks dude:)
John Robbins’s post was really useful and worked well for me.
thnx…