'AdditionalDeploymentContributors'不是“发布”操作的有效参数 [英] 'AdditionalDeploymentContributors' is not a valid argument for the 'Publish' action

查看:419
本文介绍了'AdditionalDeploymentContributors'不是“发布”操作的有效参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一组视图,其中只需要部署1个,每个部署中有一个不同的。 过滤DacPac部署应该这样做。我知道开箱即用的选项已经改进了,但这不会满足我的需要。

I have a set of views of which only 1 needs to be deployed, a different one in each deployment. Filtering DacPac deployments should do it. I'm aware the out of the box options have improved, but that won't do for my needs.

数据库通过 SqlPackage 发布,它明确列出了这些参数对发布动作有效。然而,当我使用这些,它会产生错误(红色):

The database is published through SqlPackage it explicitly lists these parameters as valid for the publish action. Yet when I use these, it produces the errors (in red):

*** 'AdditionalDeploymentContributors' is not a valid argument for the 'Publish' action.
*** 'AdditionalDeploymentContributorArguments' is not a valid argument for the 'Publish' action.

我在Deploy.ps1文件中使用以下命令:

I use the following command in a Deploy.ps1 file:

& $sqlpackageFileName /a:Publish /sf:$DacPacFileName /tcs:$ConnectionString /v:RefToOtherDatabase="${OtherDatabaseName}" /pr:$OptionsFromPublishFile /p:AdditionalDeploymentContributors="AgileSqlClub.DeploymentFilterContributor" /p:AdditionalDeploymentContributorArguments=$NordicsDeployFilter

可能是我已经从我的发布配置文件中获取了选项。但是如果我把它们放在我的PropertyGroup中,那么发布会产生错误:$ code> Contributor initial error 。无法获得更多详细信息。

It may be that I'm already getting options from my publishing profile. But if I put them in my PropertyGroup, publishing produces the error: Contributor initialization error. Can't get any more details.


  1. 为什么不能加载AdditionalDeploymentContributor

编辑:
感谢您的回复,只是为了保持问题的完整,添加了我的评论。

Thanks for your reply, just to keep the question complete, adding what's in my comment.

我使用的是SQL Server 2012,我认为是版本110.在我的文件夹结构中: Microsoft SQL Server / 110 / DAC / bin 我找不到你所指的.dll至。它在 Microsoft SQL Server / 120 / DAC / bin ,我没有安装从未版本,所以 Microsoft SQL Server / 130 / DAC / bin 包含很少,没有DAC文件夹。

I'm using SQL Server 2012, which I think is version 110. In my folder structure: Microsoft SQL Server/110/DAC/bin I cannot find the .dll you refer to. It is in Microsoft SQL Server/120/DAC/bin and I don't have a never version installed so Microsoft SQL Server/130/DAC/bin contains very little, no DAC folder.


  1. 我应该在哪里添加这些.dll?

当我尝试更改配置文件时会产生错误请检查该文件是否在另一个程序中打开。。我已经尝试停止SQL Server Windows服务,以为他们可能会使用它。 Process Explorer找不到正在使用的文件,并且Openfile无法找到任何打开的文件。即使我在Notepad ++中打开了文件,所以我不清楚那是什么。

When I try to change the config file it produces the error Please check if this file is opened in another program.. I've tried stopping SQL Server windows services, thought they might have it in use. Process Explorer can't find the file as in use and Openfiles can't find any open files. Even though I have the file open in Notepad++, so I'm unclear on what that does then.


  1. 如何编辑配置文件?

注意:我使用的是Visual Studio 2013和SQL Server 2012.使用Visual Studio 2013的SSDT工具。

Note: I'm using Visual Studio 2013 and SQL Server 2012. With SSDT tools for Visual Studio 2013.

推荐答案

我怀疑你是因为您使用Ed的贡献者使用最新版本的SqlPackage.exe而得到了Contributor的初始化错误。部署贡献者的目标是早期版本的DACFx API,我们已经更新了一些版本号。您可以通过向SqlPackage.exe.config文件添加绑定重定向来解决此问题。以下是MSDN SSDT论坛上的Jack Yang的说明( https://social.msdn.microsoft.com/Forums/sqlserver/en-US/ee3f886e-6b5e-4b95-b912-e06354534bf9/sqlpackageexe -version-130-wont-load-additionaldeploymentcontributors?forum = ssdt

I suspect you're getting that Contributor initialization error because you're using Ed's contributor with the latest version of SqlPackage.exe. The deployment contributor was built targeting an earlier version of the DACFx API and we've updated some version numbers. You can work around this by adding a binding redirect to the SqlPackage.exe.config file. Here are instructions from Jack Yang on the MSDN SSDT forum (https://social.msdn.microsoft.com/Forums/sqlserver/en-US/ee3f886e-6b5e-4b95-b912-e06354534bf9/sqlpackageexe-version-130-wont-load-additionaldeploymentcontributors?forum=ssdt)


要针对版本130运行,请修改SqlPackage.exe.config在Microsoft.SqlServer.Dac.dll和Microsoft.SqlServer.Dac.Extensions.dll上添加绑定重定向。该文件可以在SqlPackage.exe旁找到。

To run against version 130, please modify the SqlPackage.exe.config to add the binding redirect on the Microsoft.SqlServer.Dac.dll and Microsoft.SqlServer.Dac.Extensions.dll. This file can be found right next to SqlPackage.exe.

下面显示的示例

< runtime>
< assemblyBinding xmlns =urn:schemas-microsoft-com:asm.v1>
< dependentAssembly>
< assemblyIdentity name =Microsoft.SqlServer.TypespublicKeyToken =89845dcd8080cc91culture =neutral/>
< bindingRedirect oldVersion =10.0.0.0newVersion =13.0.0.0/>
< bindingRedirect oldVersion =12.0.0.0-13.0.0.0newVersion =13.0.0.0/>
< / dependentAssembly>
< dependentAssembly>
< assemblyIdentity name =Microsoft.SqlServer.TransactSql.ScriptDompublicKeyToken =89845dcd8080cc91culture =neutral/>
< bindingRedirect oldVersion =12.0.0.0-13.0.0.0newVersion =13.100.0.0/>
< / dependentAssembly>
< dependentAssembly>
< assemblyIdentity name =Microsoft.SqlServer.DacpublicKeyToken =b03f5f7f11d50a3aculture =neutral/>
< bindingRedirect oldVersion =12.0.0.0newVersion =13.0.0.0/>
< / dependentAssembly>
< dependentAssembly>
< assemblyIdentity name =Microsoft.SqlServer.Dac.ExtensionspublicKeyToken =b03f5f7f11d50a3aculture =neutral/>
< bindingRedirect oldVersion =12.0.0.0newVersion =13.0.0.0/>
< / dependentAssembly>
< / assemblyBinding>
< / runtime>

我们已经在7月份开始使用DacFx发送AppLocal版本的Microsoft.SqlServer.TransactSql.ScriptDom;因此,根据您拥有的DacFx版本,如果您在DacFx的同一个文件夹中看不到Microsoft.SqlServer.TransactSql.ScriptDom.dll,则不需要绑定重定向。它应该已经在GAC中了。

We started shipping AppLocal version of Microsoft.SqlServer.TransactSql.ScriptDom with DacFx in July; therefore, depending on which version of DacFx you have, if you didn’t see the Microsoft.SqlServer.TransactSql.ScriptDom.dll in the same folder with DacFx, then you don’t need the binding redirect for it. It should be in the GAC already.

这篇关于'AdditionalDeploymentContributors'不是“发布”操作的有效参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆