title: MSTest and app.config issue
body: <p>I am stuck trying to automate unit tests runs with MSTest and deployment of app.config. I read multiple posts and blogs, tried multiple things and yet still app.config doesn't seem to be picked up during MSTest execution. Having a dll that contains all my unit tests built with msbuild, here is what I've tried...</p>
  
  <h3>Attempt 1</h3>
  
  <ol>
  <li>Copied app.config to the same location with MyTests.dll as MyTests.dll.config (on one of the msdn forums it was said it'd be picked up automagically)</li>
  <li>Added <code>[DeploymentItem("MyTests.dll.config")]</code> attribute to each test</li>
  <li>Ran <code>MSTest.exe /noisolation /testcontainer:d:\MyTestTests.dll /test:MyTest</code></li>
  </ol>
  
  <h3>Attempt 2</h3>
  
  <ol>
  <li>Created local.testrunconfig file with the following content (below)</li>
  <li>Ran mstest with /runconfig and no isolation, but nothing was executed:  <code>MSTest.exe /runconfig:d:\local.testrunconfig /testcontainer:d:\MyTestTests.dll /test:MyTest</code></li>
  </ol>
  
  <p><strong>Result: </strong> 
  Loading d:\local.testrunconfig...<br>
  d:\local.testrunconfig<br>
  d:\local.testrunconfig  </p>
  
  <p>... and nothing happens: no errors, no tests are executed!
  <br /></p>
  
  <hr>
  
  <p><strong>EDIT/RESOLUTION:</strong> By default, MSTest executes tests in separate processes. In this case, config file is automatically picked up if it is named like "dllname.dll.config". However, it is hard to debug tests running in separate processes if they run outside of VS. /noisolation switch is used to make MSTest run all tests in one process. However, in this case test config file is <strong>NOT</strong> picked up. Instead, MSTest.exe.config file is used, which is located in the same directory as MSTest. To resolve this issue, configuration file can be loaded pragmatically like this:</p>
  
  <pre><code>
  ExeConfigurationFileMap map = new ExeConfigurationFileMap();
  map.ExeConfigFilename = @"path to config file";
  Configuration config = 
     ConfigurationManager.OpenMappedExeConfiguration(map, ConfigurationUserLevel.None);
  </code></pre>