A straightforward task takes about 10 minutes to run. To automate the task, I’ve brought in VB to “Shell” the task. After about a minute of running, VB gives up with an error screen titled “ContextSwitchingDeadlock was detected”. (It’s happened before with other tasks that run over a minute.) Could someone please tell me how to get around what ever these messages are complaining about? The error message:
The CLR has been unable to transition from COM context 0x5e3248 to COM context 0x5e30d8 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.
Thank you,
John Littell