In .NET 4, loading .NET 2 mixed-mode assemblies requires setting useLegacyV2RuntimeActivationPolicy="true"
in the startup element of the app.config file for the application project.
How can I set this (and is it necessary) for a test project? I am getting some very odd behavior in the testing host, but only for tests that use CLR 2 mixed-mode assemblies directly, so I suspect this may be the culprit...
The actual error being received is:
The test adapter 'UnitTestAdapter' threw an exception while running test 'MyTest'. Exception has been thrown by the target of an invocation. Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
However, it's not showing as a test failure, but rather as an Error. The exception appears to be happening in the unit test adapter, and not my code.