Click here to Skip to main content
14,698,806 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a SSIS package with script task element. Input columns are directed from excel source through data conversion. 2 variables are taken as Readonly Variables in script task.

All the rows processed well through my code but after processing while executing Post_Execute methode. There is no code in post_ececute.But the error is occuring. Error showing

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 '{D1A469BC-F371-4D15-832F-BACB50C162E9}' 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))

I am using VS2015 and SQL Server 2017.

What I have tried:

Tried changing variables from readonly to readwrite variables but doesn't work.
Richard Deeming 7-Jun-18 10:34am
Google has lots of results for "IDTSVariables100 RPC_E_WRONG_THREAD".

This one[^] sounds similar to what you're trying to do, and suggests checking the "TargetServerVersion" property on the SSIS project.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900