Click here to Skip to main content
15,891,607 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I am having an application wherein I am getting an error

"The CLR has been unable to transition from COM context
0x2183e0 to COM context 0x218550 for 60 seconds.
The thread that owns the destination context/apartment
is most likely either doing a non pumping wait or processing
a very long running operation without pumping Windows messages.
This situation generally has a negative performance impact
and may even lead to the application becoming non responsive
or memory usage accumulating continually over time. To avoid
this problem, all single threaded apartment (STA) threads
should use pumping wait primitives (such as
CoWaitForMultipleHandles) and routinely pump messages
during long running operations."


My application is in VB.NET windows based.

In my application I have used a thread that run continuously and at some point of time it gives me this error.

For this issue I unchecked visual studios "DEBUG->Exceptions->Managed Debugging Assistant(MDA)" here under THROW column I have unchecked "DisconnectedContext" and "ContextSwitchDeadlock". But still not able to detect the main problem....

Please suggest if any
Posted
Updated 10-Oct-20 3:51am
v2

I've seen this before and found that it is an error that only shows up when your app is running under the the Debug build under the debugger. The Release build running outside Visual Studio will never show this problem at all.
 
Share this answer
 
Comments
tnashc 8-Oct-14 12:58pm    
My app gave me that error even when I ran it in release mode.
Dave Kreskowiak 8-Oct-14 13:16pm    
If you run it under the debugger, it will throw this message. If you run the Release outside of Visual Studio, it doesn't happen.
How to use "CoWaitForMultipleHandles" ?[^]

It seems that it is just a feature of a debugger, and if you turn it off, it will not break any more.

I just found this, and it worked for my VB.NET console application (although I do not understand what is connection between a "message pump" [which sounds so windows-ly) and a console application).
 
Share this answer
 
I already faced this error message.
I read about the solutions concerned this message here: https://social.msdn.microsoft.com/Forums/office/en-US/320459e9-7247-41a2-a24e-7eda359b2686/contextswitchdeadlock-occurred?forum=csharpgeneral

Open "Exception Settings" (Ctrl+Alt+E)
Under "Managed Debugging Assistants"
We need to do uncheck "ContextSwitchDeadlock" It can solve this error.

With Regards.
KWN
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900