MDA error RRS feed

  • Question

  • I'm getting the following exception thrown...

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

    The strange part is that when working in Windows 7 this does not happen. It only happens when working on the XP development machine. I'm taking over someone's project and it's a mess but so far I've been able to get it working with a few minor exceptions. So to be able to use the robot it's connected to I configured a remote Windows XP machine exactly like my Windows 7 machine. The code runs fine on the Windows 7 machine as it doesn't produce the error. But when running it in debug mode on the XP machine I get the above error. I can't find any long running operations that I can find.

    Any thoughts regarding what configuration change I can make to the XP machine to prevent this problem? I tried to set ContextSwitchDeadlock to false but that only caused several other things to not load properly such as a SQL connection and Crystal Reports viewer.

    I appreciate your suggestions.

    Saturday, September 17, 2011 12:16 AM

All replies

  • Follow-up.....


    I've discovered the source of the issue. There is a timer which is activated on page load. When I comment out the timer.enabled = true the problem does not present. When I step through the timer_elapsed code a few times the problem doesn't present.

    The problem is not present on Windows 7 running Visual Studio 2008 running the program in debug mode but it does present when running on the Windows XP machine.  The timer's interval is set to 0.5.


    Now a bit of background... this software is attached to a robot which makes several measurements. These measurements are captures via a USB interface.


    Any help in removing this issue while working on the XP machine is greatly appreciated.

    Saturday, September 17, 2011 12:39 AM
  • Have you turned on the MDA warnings in VS on the Windows 7 machine?

    Tuesday, September 20, 2011 8:48 AM