title: mstest does not copy a library referenced in a project but is used at run-time only
body: <p>I have a project that uses Microsoft Enterprise Library and uses configuration to specify a type for caching manager. </p>
  
  <p>Loaded in this manner caching manager depends on a library <code>Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.dll</code> which <strong>is</strong> included in my test project as a reference, but the library <strong>is not</strong> being used by code directly (at compile time). As such the compiled mytests.dll will not have that library referenced (verified this using dotpeek).</p>
  
  <p><strong>Question #1:</strong> Why doesn't MSTest copy such library to the temp folder for testing?
  <strong>Question #2:</strong> Is there an elegant workaround?</p>
  
  <p>Not elegant solution <strong>#1</strong>: do a dummy reference to the included library (as mentioned <a href="http://social.msdn.microsoft.com/Forums/pl/vststest/thread/3c5e0859-0638-4ca3-b2a4-e8a1b5700d4c">in this thread</a>);  </p>
  
  <p>or solution <strong>#2</strong>: use MSTest Deploy configuration to include the library explicitly.</p>
  
  <p>solution <strong>#3</strong>:<br>
  Using a .testsettings file in mstest resolves the issue even if <strong>deployment option is turned off</strong>. I.e. testsettings file contains:</p>
  
  <pre><code>&lt;Deployment enabled="false"&gt;
  &lt;/Deployment&gt;
  </code></pre>
  
  <p>Seems like doing this causes mstest to be ran not in the temp <code>TestResults\user_HOST 2011-12-21 15_22_08\Out</code> directory, but in the <code>bin\Debug</code> (where the library in question is <em>correctly</em> deployed to).</p>
  
  <p>Is this an expected behavior of mstest? I mean the fact that mstest does not use temp directory if Deployment is disabled in the .testsettings file?</p>