Click here to Skip to main content
15,921,212 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi all,

I google to avoid this warning message from past 3 days I was getting


ContextSwitchDeadlock was detected
Message: The CLR has been unable to transition from COM context 0x44d3a8 to COM context 0x44d5d0 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.
Posted
Updated 12-May-16 23:49pm
v2

Hi all,

XML
at last I am able to avoid this warning

http://www.rocha.org/2010/05/contextswitchdeadlock-was-detected.html


Just click Ctrl+Alt+E in your project and you will get exceptions window select
 Managed Debugging Assistants you should uncheck the ContextSwitchDeadlock thats all..

Thanks all,
 
Share this answer
 
v2
This is not a solution but simply ignoring the Issue.

I have the same issue but and i know the cause is because the application i work on will switch between MTA and STA and interact with COM from managed code.

In a nut shell you need to Pump the meassages when in STA mode (well i do in my case).

Check out some of the following links:
Non pumping wait or processing a very long running operation without pumping Windows messages.[Non pumping wait or processing a very long running operation without pumping Windows messages]

contextSwitchDeadlock MDA[contextSwitchDeadlock MDA]

Resolution: Context Switch Deadlock was detected !!! | Early Bites[^]
I would not recommending ignoring the error. Instead you should attempt to fix it.
 
Share this answer
 
v2

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