title: UnitTestIsolationException: Debug Unit Test at ShimsContext.Create
body: <p>When I am trying to debug a Unit test, I receive the following exception message:</p>
  
  <blockquote>
    <p>UnitTestIsolation instrumentation failed to initialize. Please restart
    Visual Studio and rerun this test</p>
  </blockquote>
  
  <p>With this stack trace:</p>
  
  <blockquote>
    <p>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</p>
  </blockquote>
  
  <p>The code is:</p>
  
  <pre><code>var prc = new ProcessorManager(ProcessRepository,ProcessStatusRepository);
  using (ShimsContext.Create())
  {
      ShimDateTime.NowGet = () =&gt; new DateTime(2015, 10, 1);
      prc.Run();
  }
  </code></pre>
  
  <p>The exception is thrown at <code>ShimsContext.Create()</code>.</p>
  
  <p>I have reviewed the <a href="https://stackoverflow.com/questions/15607555">Visual Studio 2012 fakes UnitTestIsolation instrumentation failed to initialize</a>, and tried all the steps there but doesn't work for me. I am not using Nunit.</p>