title: Working Directory Different for Different Tests
body: <p>My team and I are working on an application that is stored in BitBucket with Visual Studio 2015 being our primary IDE. Our application's unit tests fail when the <code>DataSource</code> attribute is used, but pass when it is not.</p>
  
  <p>One thing I've noticed is that when the <code>DataSource</code> attribute is used, the working directory for the tests (obtained via the <code>System.Environment.CurrentDirectory</code> property as well as the <code>AppDomain.CurrentDomain.SetupInformation.ApplicationBase</code> property) is: </p>
  
  <blockquote>
    <p>TestResuts\[generated directory name]\Out </p>
  </blockquote>
  
  <p>The working directory when there is no <code>DataSource</code> is the project's configured output path: 'bin\Debug'. This is why the tests cannot find the <code>DataSource</code> files - though they are set to <code>Copy always</code> in the file properties, they are being copied to my bin\Debug directory and <b>not</b> my TestResults/.../Out directory.</p>
  
  <p>Here's the oddest part - we do not have a Settings file for the project and this just started happening recently. So a new working directory was not configured and we did not change this intentionally. </p>
  
  <p>Why would the DataSource attribute change the executing directory, and not copy over the file indicated in the attribute c'tor?</p>
  
  <p>Is there any other reason you can think of that this may be happening?</p>
  
  <p>Thanks!</p>