Andrew Kilburn
Andrew Kilburn

Reputation: 2251

Unable to cast COM object of type 'System._COMObject' to interface type

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

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?

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.

Upvotes: 5

Views: 23913

Answers (7)

nyrrovro
nyrrovro

Reputation: 1

If you are running the package from a Visual Studio solution in design mode and also passing the connection string to the connection manager from a config, try manually passing the connection string in the connection manager and test the connection before running the package. That worked for me.

Upvotes: 0

Manikantha N
Manikantha N

Reputation: 1

Project --> Properties --> Configuration Properties --> Debugging

and then change Run64BitRuntime to False under Debug Options

1

Upvotes: 0

R2D2
R2D2

Reputation: 71

Here is the workaround: Solution Explorer -> right click project ->properties->debugging->Run64bitRuntime->set to false.

Upvotes: 2

LarryH
LarryH

Reputation: 1

In my case this is was a validation overload/timeout, the package contained references to hundreds of tables.

Opening the offending data flow forced re-validation and cleared the error.

Upvotes: 0

JayWayze
JayWayze

Reputation: 168

In case this might help someone: I got this error due to timeout issues caused by a poorly optimised query. There was nothing inherently wrong with the SSIS package and it ran fine once i fixed the problem in the DB Source.

Upvotes: -1

Goldfish
Goldfish

Reputation: 702

I hope it helps others. The solution worked for me:

  1. I registered the assembly using the gacutil.exe. My SSIS project target server version was SQL 2012. So, I was using the DTSPipelineWrap.dll version 11.0. I opened the "Developer Command Prompt for VS2015" in Administrator mode, then typed the following command: C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\gacutil.exe /i "C:\Program Files (x86)\Microsoft SQL Server\120\SDK\Assemblies\Microsoft.SqlServer.DTSPipelineWrap.dll"
  2. Then from my SSIS script task, References--> I removed the existing DTSPipelineWrap which was using the assembly from the location "C:\Program Files (x86)\Microsoft SQL Server\120\SDK\Assemblies\Microsoft.SqlServer.DTSPipelineWrap.dll". Then in the References folder, right click-->Add Reference-->Browse find the assembly from the location "C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.SqlServer.DTSPipelineWrap\v4.0_11.0.0.0__89845dcd8080cc91\Microsoft.SQLServer.DTSPipelineWrap.dll"
  3. Click Ok. Rebuild the code and executed the package. It has worked for me.

Upvotes: 0

Andrey Morozov
Andrey Morozov

Reputation: 7989

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.

Upvotes: 5

Related Questions