Visual Basic 2005 - ContextSwitchDeadLock was detected when debugging



Dear All,

If i step over my visual basic 2005 code, i got this error:

The CLR has been unable to transition from COM context 0x1a2008 to COM
context 0x1a2178 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

Can anyone help with this? please

Thanks in advance.



Does this happen when stepping through the code or running hitting F5
and just letting it run on it's own?

If you are stepping through the code it's fairly common to get these
errors if you stop on certain lines (ones that use objects that are COM
objects or use COM interop) for extended amounts of time. Generally, if
you only get them when stepping through the code you should be ok, just
press "Continue" and go about your business. If you get them when the
code is running on it own (ie you're not stepping through) you've
probably got a big problem...


Seth Rowe

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