
SVN: The CLR has been unable to transition...
Posted Friday, 5 November, 2010 - 23:22 by tksuoran inI got OpenTK from SVN to resolve couple of issues. Now my app starts fine but after maybe 1 minute I get this:
"The CLR has been unable to transition from COM context 0x4b8390 to COM context 0x4b8500 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."


Comments
Re: SVN: The CLR has been unable to transition...
Try removing the [STAThread] attribute from your main method.
Re: SVN: The CLR has been unable to transition...
Thanks, that helped. Any insight why this change was needed?
Re: SVN: The CLR has been unable to transition...
Thanks, that helped. Any insight why this change was needed?
Re: SVN: The CLR has been unable to transition...
Apparently, the managed debug assistant doesn't like the message pump in OpenTK. Messages *are* being pumped (otherwise your application would have locked up) so I am not sure why this is happening. Things appear to work fine when running outside Visual Studio, too.
If someone has any ideas, do tell.
A "short" introduction to the COM appartment model and how it affects the CLR. It's a huge and complicated subject.