3

我正在尝试使用 msdeploy 使用 dbDacFx 提供程序来部署我的 dacpac 文件。此数据库项目使用名为 UserName 的变量来创建登录名和用户等。需要在部署期间传递此值。

所以我正在做类似...

msdeploy.exe -verb:Sync -Source:dbDacFx="c:\dev\pmwuiservices\trunk\Build\database\Database.dacpac"-dest:dbDacFx="Data Source=localhost;Integrated Security=True;Database=UIConfig", -setParam:Kind=SqlCommandVariable,scope=dbDacFx,match=UserName,value="IIS AppPool\ASP.NET V4.0"

但我得到以下信息(顺便说一下,错误消息中的 url 不存在)

Info: Adding MSDeploy.dbDacFx (MSDeploy.dbDacFx).
Info: Adding database (data source=localhost;integrated security=True;database=U
IConfig)
Info: Creating deployment plan: Pending.
Info: Verifying deployment plan: Pending.
Info: Deploying package to database: Pending.
Info: Creating deployment plan: Running.
Info: Initializing deployment (Start)
Info: Initializing deployment (Failed)
Info: Creating deployment plan: Faulted.
Info: Verifying deployment plan: Faulted.
Info: Deploying package to database: Faulted.
Error Code: ERROR_EXECUTING_METHOD
More Information: Could not deploy package.
Missing values for the following SqlCmd variables:UserName.
  Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_EXECUTING_M
ETHOD.
Error: Could not deploy package.
Error: Missing values for the following SqlCmd variables:UserName.
Error count: 1.

如何在 MSDeploy 中使用 DbDacFx 提供程序的一个用户 SqlCmd 变量?

谢谢

4

2 回答 2

1

我会确认我得到了同样的错误。Ahmed Elsayed 的文章http://www.iis.net/learn/publish/using-web-deploy/dbdacfx-provider-for-incremental-database-publishing除了有严重的拼写错误外,也没有解决 sqlcmd 变量。我个人找不到像人们通常期望的那样的“真实”参考,例如dbSqlPackage的参考。此外,我发现“-setParam:kind”和“-setParam:type”之间存在无法解释的轶事和寓言式的变化。再次没有文档来备份它并且没有实际的工作解决方案,看起来范围可以是文件名(正则表达式)。也就是说,我将参数分配给哪个。理查德的东西过去对我有用,所以我很乐意接受他的建议。

于 2013-05-28T21:41:42.540 回答
0

参数的应该是您应用它的文件名,而不是提供者scopeSqlCommandVariable

msdeploy.exe -verb:sync ^
    -Source:dbDacFx="c:\dev\pmwuiservices\trunk\Build\database\Database.dacpac"
    -dest:dbDacFx="Data Source=localhost;Integrated Security=True;Database=UIConfig" 
    -setParam:kind=SqlCommandVariable,scope=Database.dacpac$,match=UserName,value="IIS AppPool\ASP.NET V4.0"
于 2012-10-26T22:50:01.060 回答