When I am trying to debug a Unit test, I receive the following exception message:
UnitTestIsolation instrumentation failed to initialize. Please restart Visual Studio and rerun this test
With this stack trace:
at Microsoft.QualityTools.Testing.Fakes.UnitTestIsolation.UnitTestIsolationRuntime.InitializeUnitTestIsolationInstrumentationProvider() at Microsoft.QualityTools.Testing.Fakes.Shims.ShimRuntime.CreateContext() at Microsoft.QualityTools.Testing.Fakes.ShimsContext.Create() at Sample.Business.Tester.ProcessorManagerTest.Test_first_run_ever() in d:\Folder1\Sample.Business.Tester\ProcessorManagerTest.cs:line 62
The code is:
var prc = new ProcessorManager(ProcessRepository,ProcessStatusRepository);
using (ShimsContext.Create())
{
ShimDateTime.NowGet = () => new DateTime(2015, 10, 1);
prc.Run();
}
The exception is thrown at ShimsContext.Create()
.
I have reviewed the Visual Studio 2012 fakes UnitTestIsolation instrumentation failed to initialize, and tried all the steps there but doesn't work for me. I am not using Nunit.
If there is a problem with your Unit testing project, related to fakes or shims, do the following:
from the following source path: C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\PublicAssemblies