title: Error: Compilation Lock when running unit tests
body: <p>We have over 1000 unit tests. A while ago 18 of them started to fail when they were run together with the other tests. These tests run a windows workflow.</p>
  
  <p>If they are run alone they pass. </p>
  
  <ul>
  <li>The error appears to be that it cannot find the connection string. </li>
  <li>It cannot find the connection string because it does not know which config file to look in. </li>
  <li>It does not know which config file to look in because it cannot find the application context</li>
  <li>And it cannot find the application context due to a compilation lock.</li>
  </ul>
  
  <p>Anybody have any idea what could be wrong, and how to fix this? The error I am getting is:</p>
  
  <pre><code>Message: Exception message: The
  supplied connection string is not
  valid, because it contains
  insufficient mapping or metadata
  information. Parameter name:
  connectionString Inner exception  :
  System.InvalidOperationException:
  Unable to determine application
  context. The ASP.NET application path
  could not be resolved. ---&gt;
  System.Reflection.TargetInvocationException:
  Exception has been thrown by the
  target of an invocation. ---&gt;
  System.Web.HttpException: The type
  initializer for
  'System.Web.Compilation.CompilationLock'
  threw an exception. ---&gt;
  System.TypeInitializationException:
  The type initializer for
  'System.Web.Compilation.CompilationLock'
  threw an exception. ---&gt;
  System.NullReferenceException: Object
  reference not set to an instance of an
  object.    at
  System.Web.Compilation.CompilationLock..cctor()
  --- End of inner exception stack trace ---    at   System.Web.Compilation.CompilationLock.GetLock(Boolean&amp;
  gotLock)    at
  System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled()
  </code></pre>
  
  <p>Thanks</p>
  
  <p>Shiraz</p>