MsBuild Database project Publish Profile

We are using TFS and msbuild to deploy our web application using publish profiles. This is working perfectly, but I am trying to do the same for our database project, and I just can't get by the following error: Error Deploy72002: Unable to connect to master or target server 'xxx'. You must have a user with the same password in master or target server 'xxx'.

The value xxx is actually the name of the database, not the name of the server. I can't find a place to input the server name, and the server is actually xxxyyy. Anybody know how/where you would specify the server name or figure out what is wrong?

I am building the project, and using the following msbuild Arguments: /t:build /t:Publish /p:SqlPublishProfilePath=PublishProfiles/QA.xxx.publish.xml /p:Configuration=Output


Anybody know how/where you would specify the server name or figure out what is wrong?

Do you have Windows authentication or SQL authentication?

For Windows authentication, you must log on with an account that has certain permissions on that database . The specific permissions that you need vary based on what action you want to perform. This document describe each action that you might want to perform and the specific permission that you need to perform it.

For SQL authentication, you need to modify publish profile file (.xml, TargetConnectString), for example:

<TargetConnectionString>Data Source=XXX;User ID=XXX;Password=XXX;Pooling=False;MultipleActiveResultSets=False;Connect Timeout=60;Encrypt=False;TrustServerCertificate=True</TargetConnectionString>

Besides, you can build the project by using the following msbuild:

MSBUILD "....TestProject.sqlproj" /t:build "/p:Platform=AnyCPU" /t:deploy /p:TargetConnectionString="Data Source=localhost;Integrated Security=True" /p:TargetDatabase="xxx" /p:Configuration=Release /p:VisualStudioVersion=14.0
链接地址: http://www.djcxy.com/p/81650.html

上一篇: 有没有关于MSBuild脚本的很好的教程?

下一篇: MsBuild数据库项目发布配置文件