我有一组视图,其中只需要部署一个,每个部署中都有一个不同的视图。过滤 DacPac 部署 https://the.agilesql.club/Blogs/Ed-Elliott/HOWTO-Filter-Dacpac-Deployments应该这样做。我知道开箱即用的选项有改善 https://blogs.msdn.microsoft.com/ssdt/2015/02/23/new-advanced-publish-options-to-specify-object-types-to-exclude-or-not-drop/,但这不能满足我的需要。
数据库发布通过sql包 https://msdn.microsoft.com/en-us/hh550080(v=vs.103).aspx它明确列出了这些对发布操作有效的参数。然而,当我使用它们时,它会产生错误(红色):
*** 'AdditionalDeploymentContributors' is not a valid argument for the 'Publish' action.
*** 'AdditionalDeploymentContributorArguments' is not a valid argument for the 'Publish' action.
我在 Deploy.ps1 文件中使用以下命令:
& $sqlpackageFileName /a:Publish /sf:$DacPacFileName /tcs:$ConnectionString /v:RefToOtherDatabase="${OtherDatabaseName}" /pr:$OptionsFromPublishFile /p:AdditionalDeploymentContributors="AgileSqlClub.DeploymentFilterContributor" /p:AdditionalDeploymentContributorArguments=$NordicsDeployFilter
我可能已经从我的发布配置文件中获得了选项。但如果我将它们放入 PropertyGroup 中,发布会产生错误:Contributor initialization error
。无法获得更多详细信息。
- 为什么无法加载AdditionalDeploymentContributor
编辑:
感谢您的回复,只是为了保持问题完整,添加我评论中的内容。
我正在使用 SQL Server 2012,我认为它是版本 110。在我的文件夹结构中:Microsoft SQL Server/110/DAC/bin
我找不到您引用的 .dll。它是在Microsoft SQL Server/120/DAC/bin
而且我没有安装过版本所以Microsoft SQL Server/130/DAC/bin
包含很少,没有 DAC 文件夹。
- 我应该在哪里添加这些 .dll?
当我尝试更改配置文件时,它会产生错误Please check if this file is opened in another program.
。我尝试停止 SQL Server Windows 服务,认为他们可能正在使用它。 Process Explorer 找不到正在使用的文件,Openfiles 找不到任何打开的文件。尽管我在 Notepad++ 中打开了该文件,所以我不清楚它的作用。
- 我必须做什么才能编辑配置文件?
注意:我使用的是 Visual Studio 2013 和 SQL Server 2012。使用 Visual Studio 2013 的 SSDT 工具。