title: prevent vstest discovery engine locking DLLs
body: <p>I have some C# unit tests for a VS2012 project which calls a VS2010 c++ DLL using DllImport pinvoke. </p>
  
  <p>As a pre-build event for the test project, I copy the latest version of the DLL to the binary project for the test.</p>
  
  <p>This repeatedly fails if vstest.discoveryengine is running. It appears that the 'discovery engine' is loading the tests and holding the lock on the DLL. </p>
  
  <p>If I kill vstest discovery engine, then I can build and run the tests. otherwise the build fails, and VS2012 offers to run a previous version ( with a model dialog which doesn't have a 'don't show this message again' option)</p>
  
  <p>Is there something I can do to either force the test project to unload the DLL when not actually running the tests, or to disable the background discovery executable?</p>
  
  <p>I've hacked a workaround by creating an executable called Kealakekua which kills vstest.discoveryengine.x86, vstest.executionengine.x86, and with that as the first part of the pre-build event it can copy the files and build, but would prefer not to be fighting visual studio for my file.</p>