无法将“System._COMObject"类型的 COM 对象转换为接口类型

无法将“System._COMObject

问题描述:

我有 3 个 SSIS 包.三个 SSIS 包中的两个完美运行,第三个.这是第二个的副本,除了更改连接字符串不断抛出问题:

I have 3 SSIS packages. Two out of the 3 SSIS packages work perfectly, the third. Which is a copy of the 2nd one, except changing connection strings keeps throwing the problem:

Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.SqlServer.Dts.Pipeline.Wrapper.IDTSObject100'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{D4E5AF42-7999-473C-8082-6EFC676953C4}' 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)).

自从我复制包裹以来,它一直在这样做.我已经按照在线指南运行了 regsvr32 dts.dll,这表明它成功了,但没有任何改变.我仍然收到错误,这是为什么?

It has been doing this ever since I copied the package over. I have followed through online guides and run the regsvr32 dts.dll and this said it was successful but nothing has changed. I still get the error, why is this?

SSIS 包似乎验证了我的容器,与其他两个相比,这样做需要很长时间,然后在验证中失败并抛出上述错误消息.

The SSIS package seems to validate my containers, it takes a long time to do this compared to the other two and then fails later on in the validation throwing the above error message.

您不能只复制包,但您还需要更改名称并生成新的 GUID(用于标识 COM对象)用于此包.查看这篇 MSDN 文章了解更多信息.

You can't just copy the package, but you need additionally to change the name and generate new GUID (which identifies the COM object) for this package. Check this MSDN article for more info.