title: SQL Server Database Unit Testing and Continuous Integration
body: <p>I have a suite of SQL Server Database Unit Tests built in Visual Studio 2013 to test stored procedures and functions. The tests run fine against my local database but I also want them to be run against a DEV server's DB as part of a CI process.</p>
  
  <p>To achieve this I am building the test DLL and copying both the DLL and config file to the DEV server and then running the command line vstest.console.exe to test.  This works fine on my local machine but when I try to run it on DEV I get the following exception for each test:</p>
  
  <blockquote>
    <p>An error occurred while SQL Server unit testing settings were being read from the configuration file. Click the test project, open the SQL Server Test Configuration dialog box from the SQL menu, add the settings to the dialog box, and rebuild the project.</p>
  </blockquote>
  
  <p>I have tried using slow cheetah to ensure that an App.Config transform is applied before the solution is built and I can see that the transform is being applied in the config file, but still my tests fail.</p>
  
  <p>Has anyone figured out a way to do this? It seems strange that the DLL has to be rebuilt to consume connection string changes in a config file.</p>
  
  <p>I also tried following the suggestions in this <a href="http://sqlblogcasts.com/blogs/sqlandthelike/archive/2013/01/07/ssdt-tsql-unit-testing-in-multiple-environments.aspx" rel="nofollow noreferrer">post</a> but without success.</p>