423,834 Members | 1,336 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 423,834 IT Pros & Developers. It's quick & easy.

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

P: n/a
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.
Jul 28 '06 #1
Share this Question
Share on Google+
7 Replies


P: n/a
How long are your lines of code????!!!

--
Of all words of tongue and pen, the saddest are: "It might have been"

Bill.Richards @ greyskin .co .uk
http://greyskin.co.uk
"Rob R. Ainscough" wrote:
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.
Jul 28 '06 #2

P: n/a
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

Rob R. Ainscough wrote:
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.
Jul 28 '06 #3

P: n/a
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.
"Brian Gideon" <br*********@yahoo.comwrote in message
news:11**********************@i3g2000cwc.googlegro ups.com...
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

Rob R. Ainscough wrote:
>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.

Jul 28 '06 #4

P: n/a
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

Rob R. Ainscough wrote:
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.

Jul 28 '06 #5

P: n/a
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.

"Brian Gideon" <br*********@yahoo.comwrote in message
news:11**********************@m73g2000cwd.googlegr oups.com...
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

Rob R. Ainscough wrote:
>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.


Jul 30 '06 #6

P: n/a
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

Rob R. Ainscough wrote:
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.
Jul 31 '06 #7

P: n/a
Brian thanks, Rob.

"Brian Gideon" <br*********@yahoo.comwrote in message
news:11**********************@m79g2000cwm.googlegr oups.com...
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

Rob R. Ainscough wrote:
>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.

Jul 31 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.