c# - SSIS 脚本组件在手动打开之前无法加载程序集

标签 c# sql-server visual-studio ssis biml

我正在通过 Biml(根据 Varigence BimlExpress page 使用当前版本的 BimlExpress)创建一个 SSIS 项目,该项目在数据流任务中使用脚本组件。该项目创建时没有问题,但是在到达脚本组件时出错:

Could not load file or assembly 'Microsoft.SqlServer.DTSPipelineWrap, Version=14.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.

at ScriptMain.PreExecute() at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.PreExecute()

我可以在 GAC 中看到这个 dll,当我尝试手动添加引用时,SSIS 指出我无法添加它,因为它已经包含在项目中。

但是,如果我打开脚本组件并手动构建它 - 但不做任何更改 - 数据流任务将顺利运行。

澄清一下,我知道我没有改变任何其他东西,因为每次我想测试一种新方法时,我都会从 Biml 重新创建这个项目,它提供了一致的基线。


有谁知道为什么包含对 GAC dll 的引用的脚本组件只能在手动构建而不是事先构建时工作?

虽然在不同的环境中,但我以前毫无问题地使用过这个确切的 Biml。已针对 SQL Server 2016 实例使用 Visual Studio 2012,但未在针对 SQL Server 2016 实例的 Visual Studio 2015(目标 2012)中使用。

为了进一步了解上下文,我还测试了此输出针对 SQL Server 2012、2014 和 2016 的 SSIS 项目,并显示完全相同的错误消息。


更新

这看起来肯定是项目中的 dll 版本问题,作为 BimlExpress 的输出,因为如果我手动创建 v4.0_14.100.0.0__89845dcd8080cc91 文件夹,其中包含版本 13 dll,位于 C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.SqlServer.DTSPipelineWrap 脚本组件现在出现以下错误:

System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.SqlServer.Dts.Pipeline.Wrapper.IDTSComponentMetaData100'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{ID removed just in case}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.HandleUserException(Exception e)

at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.PreExecute()

at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostPreExecute(IDTSManagedComponentWrapper100 wrapper)

最佳答案

我猜你的问题可能与 Express 版本有关。

在相关页面查看Express和BimlStudio版本之间的差异(“与BimlStudio比较”按钮下的功能比较表):

https://www.varigence.com/BimlExpress

关于c# - SSIS 脚本组件在手动打开之前无法加载程序集,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45239315/

相关文章:

sql-server - UCS-2和SQL Server

c# - 实际引用而不是复制 PtrToStructure?

c# - Visual Studio 和 Eclipse 哪个更好

visual-studio - 预览 Xamarin 表单页面

c# - xamarin.android.support.compat 28.0.0.1 与 netstandard2.0 不兼容

c# - 如何为我的文本框手动创建 mask ?

javascript - 在 asp.net WebApi 中将表数据序列化为 IEnumerable

c# - Java 与 C# Web 服务客户端

sql-server - 在服务器代理中执行的 SSIS 包不执行其工作(即使报告成功)

c# - 将 SSIS 包转换为 .NET 应用程序?