The CLR has been unable to transition...for 60 seconds....

R

Rob R. Ainscough

I get this A LOT while I'm stepping thru my code in Debug mode.

"The CLR has been unable to transition from COM context 0x1a0348 to COM
context 0x1a04b8 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."

Is there a work around because sometimes I take longer than 60 seconds to go
over my next line of code.
 
B

Brian Gideon

Rob,

This sounds like the ContextSwitchDeadlock Managed Debugging Assistant
(MDA). It can be deactivated by going into Debug | Exceptions and then
uncheck ContextSwitchDeadlock underneath Managed Debugging Assistants.
It can also be deactivated via the app.config. But, I wouldn't just
blindly deactivate this MDA without at least knowing why it's
occurring.

Brian
 
R

Rob R. Ainscough

Brian,

How can I determine why it is occuring? This always happens if i spend more
than 60 seconds on a single line of code, say if I'm looking at a long
complex string containing values that I parse out and I'm checking positions
or content within the string. Or if I step thru code and go get a cup of
coffee and return and the try to step to the next line.

What are the implications with "deactivating" this MDA option?

Thanks, Rob.
 
B

Brian Gideon

Rob,

I'd say it's occurring because you are essentially stalling the message
loop by spending a lot of time stepping through code. In your case
it's probably more of a nuisance than anything else. I'd just disable
it. The implications of disabling it are that you may lose a useful
tool for discovering bugs before you release the application. MDAs are
disabled in release builds anyway. That's why you only see it during a
debugging session.

Brian
 
R

Rob R. Ainscough

Brian,

Yes, just a nuisance, I will disable -- but to be honest, I haven't found
where in the VS 2005 I can disable? No such option under Debug. Is this a
C# only option?

Rob.
 
B

Brian Gideon

Rob,

Right click on the toolbar area and select Customize. You'll find it
in the list of commands under Debug. Just drag it up to your Debug
menu. It wasn't in the menu with my install either.

Brian
 
R

Rob R. Ainscough

Brian thanks, Rob.

Brian Gideon said:
Rob,

Right click on the toolbar area and select Customize. You'll find it
in the list of commands under Debug. Just drag it up to your Debug
menu. It wasn't in the menu with my install either.

Brian
 

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

Top