当我运行我的包时,我遇到了一个有效的问题。它在我的电脑上运行失败,在其他任何人上运行成功。该错误是由Script Component(变为红色)引起的,并且处于Post Execute阶段,而不是脚本组件中的post execute,而是在包的运行时。错误是:
Information: 0x40043008 at Data Flow Task, SSIS.Pipeline: Post Execute phase is beginning.
Error: 0xC0047062 at Data Flow Task, Script Component [263]: System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.SqlServer.Dts.Runtime.Wrapper.IDTSVariables100'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{22992C1D-393D-48FB-9A9F-4E4C62441CCA}' failed due to the following error: The application called an interface that was marshalled for a different thread. (Exception from HRESULT: 0x8001010E (RPC_E_WRONG_THREAD)).
我猜这个问题与变量有关,因为当我删除所有与变量相关的代码时,包运行成功。脚本组件中的代码:
private int scheduled550;
private int scheduled620;
private int scheduled720;
private int scheduled820;
public override void PreExecute()
{
base.PreExecute();
scheduled550 = Variables.Count550;
scheduled620 = Variables.Count620;
scheduled720 = Variables.Count720;
scheduled820 = Variables.Count820;
}
public override void PostExecute()
{
base.PostExecute();
}
有没有人遇到过同样的问题?谁能告诉我 POST Execute 阶段会做什么?谢谢
更多信息:我尝试重新安装 SQL Server,但这无济于事。并非所有带有变量的脚本组件都无法在我的 SSIS 中运行(与错误之一不在同一个包中)