Search This Blog

Thursday, January 6, 2011

"CLR has been unable to transition from COM context for 60 seconds" error in Visual Studio

This is an error in VS2008 I've gotten infrequently that appears when running a really long process (in my case, a recursive treewalk of a very large Active Directory structure) in the Visual Studio Debugger.

The title of the messagebox is ""ContextSwitchDeadlock was detected" and the text reads like: "The CLR has been unable to transition from COM context 0x12345 to COM context 0x54321 for 60 seconds ..."

The code is not the problem, it's the debugger being helpful when it thinks there's a runaway process.

The answer is to change some settings in the debugger to stop Visual Studio from halting on long processes: "Debug", then "Exceptions", then "Managed Debug Assistants". Uncheck the box for "ContextSwitchDeadlock."

One note -- this is not a system-wide settings change, it seems to be in the project's .suo file and specific to the project you're debugging.

1 comment:

Unknown said...

Life is all about timing... the unreachable becomes reachable, the unavailable become available, the unattainable... attainable. Have the patience, wait it out It's all about timing. See the link below for more info.


#unavailable
www.ufgop.org
\