手动打开之前,SSIS脚本组件无法加载程序集 [英] SSIS Script Component Cannot Load Assembly Until Manually Opened

查看:306
本文介绍了手动打开之前,SSIS脚本组件无法加载程序集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过Biml创建一个SSIS项目(根据 Varigence BimlExpress页面,使用BimlExpress的当前版本. )在数据流任务中使用脚本组件.创建该项目时不会出现问题,但是进入脚本组件时会出错:

I am creating a SSIS project via Biml (Using the current version of BimlExpress per the Varigence BimlExpress page) that uses a script component within a Data Flow Task. The project is created without issue however errors when it gets to the Script Component:

无法加载文件或程序集"Microsoft.SqlServer.DTSPipelineWrap,版本= 14.100.0.0,文化=中性,PublicKeyToken = 89845dcd8080cc91"或其依赖项之一.系统找不到指定的文件.

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.

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

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

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

I can see this dll within the GAC and when I try to add the reference manually, SSIS states that I can't add it as it is already included in the project.

但是,如果我打开脚本组件并手动Build,但没有进行任何其他更改,则数据流任务将毫无问题地运行.

However, if I open the Script Component and manually Build it - but change nothing else - the Data Flow Task will run through without issue.

为澄清起见,我知道我每次都想通过Biml重新创建此项目时都没有做任何其他更改,因此我想测试一种提供一致基线的新方法.

To clarify, I know I have changed nothing else as I am recreating this project from the Biml each time I want to test a new approach, which provides a consistent baseline.

有人知道为什么包含对GAC dll的引用的脚本组件仅在手动Built时才起作用,而在事前不起作用吗?

Does anyone know why a Script Component that includes a reference to a GAC dll, will only work when manually Built but not beforehand?

尽管在不同的环境中,我之前也使用过这个确切的Biml,但没有出现问题.在SQL Server 2016实例上使用Visual Studio 2012进行了工作,但在SQL Server 2016实例的Visual Studio 2015(定位于2012年)中没有进行此操作.

I have used this exact Biml before without issue, though on a different environment. Worked using Visual Studio 2012 against a SQL Server 2016 instance yet doesn't here within Visual Studio 2015 (targeting 2012) against a SQL Server 2016 instance.

对于其他情况,我还测试了针对SQL Server 2012、2014和2016的SSIS项目的输出,并带有完全相同的错误消息.

For further context I have also tested this outputting the SSIS Project targeted at SQL Server 2012, 2014 and 2016 with the exact same error message.

这似乎是BimlExpress输出的项目中的一个dll版本问题,因为如果我手动创建v4.0_14.100.0.0__89845dcd8080cc91文件夹,其中C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.SqlServer.DTSPipelineWrap里面的版本是13 dll,则脚本组件现在会出现以下错误:

This appears to definitely be a dll version problem in the project as output from BimlExpress, in that if I manually create the v4.0_14.100.0.0__89845dcd8080cc91 folder with the version 13 dll inside at C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.SqlServer.DTSPipelineWrap the script component now errors out with the following:

System.InvalidCastException:无法将类型为"System .__ ComObject"的COM对象转换为接口类型为"Microsoft.SqlServer.Dts.Pipeline.Wrapper.IDTSComponentMetaData100".此操作失败是因为由于以下错误而导致IID为'{ ID }'的接口的COM组件上的QueryInterface调用因以下错误而失败:不支持此类接口(HRESULT的异常:0x80004002( E_NOINTERFACE)).

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)).

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

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

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

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

在Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostPreExecute(IDTSManagedComponentWrapper100包装器)

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

推荐答案

我想您的问题可能与Express版本有关.

I guess your problem may be related to the Express version.

在相关页面上查看Express版本和BimlStudio版本之间的区别(与BimlStudio比较"按钮下的功能比较表):

See at the related page the differences between Express and BimlStudio versions (Feature Comparison Chart under "Compare with BimlStudio" button):

https://www.varigence.com/BimlExpress

这篇关于手动打开之前,SSIS脚本组件无法加载程序集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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