SQL Server Data Tools:加载自定义 DeploymentPlanModifier 时出错:无法加载带有 id 的必需贡献者 [英] SQL Server Data Tools: Error loading custom DeploymentPlanModifier: Required contributor with id could not be loaded

查看:24
本文介绍了SQL Server Data Tools:加载自定义 DeploymentPlanModifier 时出错:无法加载带有 id 的必需贡献者的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要拦截一个 SSDT 构建来修改构建脚本.我遵循了 MSDN 部署计划修改器教程,但是当我尝试构建数据库项目时,出现以下错误:

I need to intercept an SSDT build to modify the build script. I've followed the MSDN Deployment Plan Modifier tutorial, but when I attempt to build the database project, I get the following error:

Required contributor with id 'MyDeploymentContributor.SqlRestartableScriptContributor'
could not be loaded.

我使用的是 Visual Studio 2012(版本 11.0.61219.00 更新 5)和 SSDT 版本 11.1.50730.0.

I am using Visual Studio 2012 (Version 11.0.61219.00 Update 5) and SSDT Version 11.1.50730.0.

我签署了程序集但没有指定密码.

I signed the assembly but did not specify a password.

我在网上找到的几种解决方案都无济于事,包括以下内容:

I've followed several solutions I've found online to no avail, including the following:

  1. 更新 Visual Studio 和 SSDT;
  2. 将 MyDeploymentContributor.dll 和 MyDeploymentContributor.pdb 复制到以下位置:

  1. Updating Visual Studio and SSDT;
  2. Copying MyDeploymentContributor.dll and MyDeploymentContributor.pdb to the following locations:

  1. C:\Program Files (x86)\Microsoft SQL Server\110\DAC\bin\Extensions
  2. C:\Program Files (x86)\Microsoft SQL Server\110\DAC\bin
  3. C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\Microsoft\SQLDB\DAC\120
  4. C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\Microsoft\SQLDB\DAC\120\Extensions

  • 捕获 SSDT 和 DacFx 的事件日志(按照 Kevin Cunnane 在 https://social.msdn.microsoft.com/Forums/en-US/5c84ab8e-b50b-4ecd-86da-866ac3bb2248/known-issue-with-ssdt-extensibility-in-current-release?forum=ssdt).以下是 DacFx 日志的结果:

  • Capturing an event log for SSDT and DacFx (following Kevin Cunnane's instructions at https://social.msdn.microsoft.com/Forums/en-US/5c84ab8e-b50b-4ecd-86da-866ac3bb2248/known-issue-with-ssdt-extensibility-in-current-release?forum=ssdt). Here are the results from the DacFx log:

    • 核心服务:SafeDirectoryCatalog:程序集 C:\Program Files(x86)\Microsoft Visual Stusio 11.0\Common7\IDE\Extensions\Micrsoft\SQLDB\DAC\120\Extensions\MyDeploymentContributor.dll添加
    • 核心服务:扩展查找:目录 <代码>C:\Program Files(x86)\Microsoft Visual Stusio 11.0\Common7\IDE\Extensions\Micrsoft\SQLDB\DAC\120\Extensions 添加到扩展查找路径
    • 核心服务:FilteringCompositionContainer:查找导出Microsoft.SqlServer.Dac.Deployment.DeploymentPlanExecutor
    • 核心服务:FilteringCompositionContainer:更改了部件创建策略到非共享
    • 核心服务:FilteringCompositionContainer:查找导出Microsoft.SqlServer.Dac.Deployment.DeploymentPlanModifier
    • Core Services: SafeDirectoryCatalog: Assembly C:\Program Files (x86)\Microsoft Visual Stusio 11.0\Common7\IDE\Extensions\Micrsoft\SQLDB\DAC\120\Extensions\MyDeploymentContributor.dll added
    • Core Services: Extension Lookup: directory C:\Program Files (x86)\Microsoft Visual Stusio 11.0\Common7\IDE\Extensions\Micrsoft\SQLDB\DAC\120\Extensions added to extension lookup path
    • Core Services: FilteringCompositionContainer: Looking up exports for Microsoft.SqlServer.Dac.Deployment.DeploymentPlanExecutor
    • Core Services: FilteringCompositionContainer: Changed part creation policy to NonShared
    • Core Services: FilteringCompositionContainer: Looking up exports for Microsoft.SqlServer.Dac.Deployment.DeploymentPlanModifier

    没有 ContributorLoader 消息.从这个日志中,贡献者似乎正在正确加载.SSDT 日志不包含任何提及贡献者的事件.

    There were no ContributorLoader messages. From this log, the contributor seems to be loading correctly. The SSDT log didn't contain any events that mentioned the contributor.

    没有必需的贡献者参数,因此我的 .sqlproj 文件中的 DeploymentContributor 节点如下所示:

    There are no required contributor arguments, so the DeploymentContributor node in my .sqlproj file looks like this:

    <PropertyGroup>
        <DeploymentContributors>
            $(DeploymentContributors); MyDeploymentContributor.SqlRestartableScriptContributor
        </DeploymentContributors>
    </PropertyGroup>
    

    感谢任何帮助.谢谢!

    推荐答案

    感谢 Ed Elliot ( https://the.agilesql.club/Blogs/Ed-Elliott/About ),在我的案例中,我能够解决这个问题.

    Thanks to Ed Elliot ( https://the.agilesql.club/Blogs/Ed-Elliott/About ), I was able to resolve this issue in my case.

    我遵循了 Ed 的建议,并且奏效了.我创建了一个文件夹,如 C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Microsoft\SQLDB\DAC\120\Extensions\[YourContributorName]\ 并复制所有内容(包括 DLL)从 C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Microsoft\SQLDB\DAC\120 到那里.

    I followed Ed's suggestions and it worked. I created a folder like C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Microsoft\SQLDB\DAC\120\Extensions\[YourContributorName]\ and copied all the contents (including DLLs) from C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Microsoft\SQLDB\DAC\120 to there.

    在贡献者项目中,我引用了 C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Microsoft\SQLDB\DAC\120\Extensions\[YourContributorName]\ 中的 DLL

    In the contributor project, I referenced the DLLs inside C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Microsoft\SQLDB\DAC\120\Extensions\[YourContributorName]\

    成功构建项目后,我将贡献者 .dll 和 .pdb 文件复制到以下位置:

    Once the project was built successfully, I copied the contributor .dll and .pdb files to the following location:

    C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Microsoft\SQLDB\DAC\120\Extensions\[YourContributorName]\

    之前,我从 C:\Program Files (x86)\Microsoft SQL Server\110\DAC\bin 引用 DLL.

    Before, I was referencing the DLLs from C:\Program Files (x86)\Microsoft SQL Server\110\DAC\bin.

    希望这对某人有所帮助.

    Hope this would help someone.

    这篇关于SQL Server Data Tools:加载自定义 DeploymentPlanModifier 时出错:无法加载带有 id 的必需贡献者的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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