Reputation: 9463
I have a database project in Visual Studio 2012. I am trying to create an MSBuild project to publish the database on the build server. In my solution, I have a Publish Profile that I would like to use on the build server.
I have the following target setup:
<Target Name="BuildDatabases">
<MSBuild Projects="$(DBProjectPath)" Targets="Build;Deploy" Properties="DeployOnBuild=true;SqlPublishProfilePath=BuildServer.publish">
</MSBuild>
</Target>
I've tried a combination of PublishProfile and SqlPublishProfilePath to no avail. I always receive:
Deploy Error: The connection string is not valid
I can use the Publish Profile inside VS with no connection issues.
Upvotes: 5
Views: 3200
Reputation: 9463
Figured it out:
<Target Name="BuildDatabases">
<MSBuild Projects="$(DBProjectPath)" Targets="Build;Publish" Properties="DeployOnBuild=true;SqlPublishProfilePath=BuildServer.publish.xml">
</MSBuild>
</Target>
I had to use "Build;Publish" for target, I was using "Build;Deploy"
Upvotes: 7