Reputation: 89
My unit test fails on line shimscontext.create.
Error is: UnitTestIsolation instrumentation failed to initialize. Please restart Visual Studio and rerun this test
As per existing posts, I tried to install NUnit adapter and I tried running it from test explorer, still no luck.
Any comments on what I am doing wrong?
Thanks
Upvotes: 4
Views: 2870
Reputation: 101
Go to your TestProject Properties -> Under Debug section Check the
"ENABLE NATIVE CODE DEBUGGING"
checkbox.
This is should do.
Upvotes: 4
Reputation: 121
I was having a similar issue. Make sure you are using the msbuild.exe located in the 12.0 folder and run the tests with vstest.exe instead of mstest.exe.
VStest Command line: http://msdn.microsoft.com/en-us/library/jj155796.aspx
Upvotes: 1
Reputation: 6558
This error is reported when the shims runtime is unable to connect to the IntelliTrace profiler, which provides runtime instrumentation necessary to detour CLR methods. The IntelliTrace profiler is automatically started by the CLR when the COR_PROFILER environment variable is set for the test runner process (vstest.executionengine*.exe). If the shims runtime reports this error, it means something went wrong and the COR_PROFILER variable was not set correctly and the IntelliTrace profiler was not loaded.
There are several potential causes of this problem. It is hard to tell without a closer look. In Visual Studio 2012, you can find additional information about it from the application event log. In Visual Studio 2013, this information is included in the exception error message itself.
Upvotes: 0