ContextSwitchDeadlock was detected



I am getting a Message Box displayed in which the error message is:
"The CLR has been unable to transition from COM context 0x1b0538 to COM
context 0x1b06a8 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

This is happening mostly when I go into debug mode and I am stepping thru
the code, but it also happens when I have a long running query or a process
which itterates through the file and takes long then 60 seconds to complete.

How can I get this error/dialog box to go away?

The dialog box indicates that the message is being generated via "MDA"
(Managed Debugging Assistant) and if I click on the link, it provides
information as to disable, but I don't think I want to disable. I would seem
that I should have parameter which I can set to allow the dialog box to not
be triggered after XXX seconds. I do not see any parameter for doing that...


This was talked about a little in microsoft.public.dotnet.languages.vb.

QUOTE FROM Brian Gideon
ContextSwitchDeadlock is one of several new Managed Debugging
Assistants (MDA). It is not compiled into release builds so that's
probably why you don't see them outside of the debugger. It can be
disabled via the config file.


See if this link works*dotnet*&rnum=3&hl=en&#doc_8e8a0454fb5bc265

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question