'AdditionalDeploymentContributors' is not a valid argument for the 'Publish' action

本小妞迷上赌 提交于 2019-12-08 00:57:36

问题


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.

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.

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

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. Why can't it load the AdditionalDeploymentContributor

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

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. Where should I be adding these .dlls?

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. What must I do to edit the config file?

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


回答1:


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)

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.

Example shown in below,

<runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="Microsoft.SqlServer.Types" publicKeyToken="89845dcd8080cc91" culture="neutral" /> <bindingRedirect oldVersion="10.0.0.0" newVersion="13.0.0.0" /> <bindingRedirect oldVersion="12.0.0.0-13.0.0.0" newVersion="13.0.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Microsoft.SqlServer.TransactSql.ScriptDom" publicKeyToken="89845dcd8080cc91" culture="neutral" /> <bindingRedirect oldVersion="12.0.0.0-13.0.0.0" newVersion="13.100.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Microsoft.SqlServer.Dac" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <bindingRedirect oldVersion="12.0.0.0" newVersion="13.0.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Microsoft.SqlServer.Dac.Extensions" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <bindingRedirect oldVersion="12.0.0.0" newVersion="13.0.0.0" /> </dependentAssembly> </assemblyBinding> </runtime>

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.



来源:https://stackoverflow.com/questions/38793315/additionaldeploymentcontributors-is-not-a-valid-argument-for-the-publish-act

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!