I am writing a C # unit test to test the C ++ / CLI functionality, which includes threads.
C ++ / CLI code implements the DirectShow filter, the Windows API for rendering movies. This works in such a way that I create DirectShow objects, I say that it launches AVI through my C ++ / CLI filters, waits until the rendering is complete, and then exits. My filter has a callback that passes video frames to C # for processing. DirectShow works in such a way that it creates its own thread and calls my COM objects from this thread.
Now this stuff works when I run my code normally, but when I run the unit test from Resharper it fails with the error "Unable to pass GCHandle via AppDomains".
Something is wrong, just that Resharper uses AppDomains in its testrunner, and the DirectShow stream is somehow not related to this appdomain.
So, how do I do this test work with Resharper? Is there a NUnit / Resharper parameter to manage if domain applications are used? Can I tell the CLR that the thread is associated with a particular appdomain? Do you know any other pragmatic workarounds?
TIA Jan
user180326
source share