CLR has been unable to transition from COM context for 60 seconds

时间:2020-12-24 17:03:28

Original link: http://blog.wpfwonderland.com/2007/08/16/clr-has-been-unable-to-transition-from-com-context-for-60-seconds/

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.

CLR has been unable to transition from COM context for 60 seconds

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 theContextSwitchDeadlock

CLR has been unable to transition from COM context for 60 seconds

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!