5

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.

1 Answer 1

7

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"

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.