Let us say I have a sql server data tools project (SSDT) and a bunch of integration/end-to-end tests (deliberate not saying unit tests). Is there a way to TearDown and republish the existing test database via code from the test class library?
PS:
I am currently trying this (paths and file names simplified):
var p = new System.Diagnostics.Process
{
StartInfo =
{
FileName =
@"C:\Program Files (x86)\Microsoft SQL Server\110\DAC\bin\sqlpackage.exe /Action:Publish /SourceFile:“D:\Database_20151114_18-23-29.dacpac” Profile:”D:\LocalDatabase.publish.xml”",
UseShellExecute = true
}
};
p.Start();
Unfortunately, I am getting:
{"The system cannot find the file specified"}
The dacpac and xml file is definitely there. Any ideas? Also, is it possible to create the latest dacpac file automatically?