WinSCP no longer working within SSIS Script Tasks

Advertisement

Guest

WinSCP no longer working within SSIS Script Tasks

I have some existing SSIS packages that have been working using WinSCP within a Script Task to send/receive files using SFTP.

The SSIS packages are now throwing an error when attempting to execute the script task. The debugger is not available as the script task cannot be instantiated.

Error: Exception has been thrown by the target of an invocation.
Within the script editor the Code Analysis tool (Menu > Build > Run Code Analysis on...) produces the following issue:

'ScriptMain' is marked ComVisible(true) but has the following
ComVisible(false) types in its object hierarchy: 'VSTARTScriptObjectModelBase'
I tried decorating the class and Main method with [ComVisible(false)] which did not work.

WinSCP v5.9.6 (no longer works using SSIS 2012).

How can I resolve this issue?

Reply with quote

Advertisement

Guest

Yes I posted here because the users in this forum are probably more experienced implementing WinSCP in SSIS and I have not gotten any positive results with StackOverflow

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
29,095
Location:
Prague, Czechia

I've asked you for additional information on Stack Overflow and you have never responded!
_________________
Martin Prikryl

Reply with quote

Guest

Re: WinSCP no longer working within SSIS Script Tasks

I'm having a similar issue. SSIS project / packages were created using VS2013, SSDT-BI for VS2013, WinSCP 5.7.5; deployed on Sql Server 2014. We've upgraded to VS2017, SSDT for VS2017, WinSCP 5.11.2; deploying SSIS project / packages to same server (Sql 2014). Had to make minor change(s) to project/packages, as target database was migrated to Sql 2016 (new server); managed to make packages run locally (in VS 2017), but deploying to SSIS server, the job / packages fail. Error message:
Exception has been thrown by the target of an invocation.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
29,095
Location:
Prague, Czechia

Re: WinSCP no longer working within SSIS Script Tasks

Anonymous wrote:

I'm having a similar issue. SSIS project / packages were created using VS2013, SSDT-BI for VS2013, WinSCP 5.7.5; deployed on Sql Server 2014. We've upgraded to VS2017, SSDT for VS2017, WinSCP 5.11.2; deploying SSIS project / packages to same server (Sql 2014). Had to make minor change(s) to project/packages, as target database was migrated to Sql 2016 (new server); managed to make packages run locally (in VS 2017), but deploying to SSIS server, the job / packages fail. Error message:
Exception has been thrown by the target of an invocation.
This exception must have an inner exception that contains the real error. Without knowing that, we cannot help you. Though make sure you use the same version of WinSCP and WinSCP .NET assembly.

Reply with quote

jwdvorak
Joined:
Posts:
1
Location:
Juneau, AK

Re: WinSCP no longer working within SSIS Script Tasks

martin wrote:

This exception must have an inner exception that contains the real error. Without knowing that, we cannot help you. Though make sure you use the same version of WinSCP and WinSCP .NET assembly.
Unable to debug, the error does not occur running locally; it occurs when running on server as the SSIS task tries to invoke the script which references WinSCP. Although the version of WinSCP on local machine and server are different, the executable / dll are located in the same location on both; the reference resolves on local and server successfully.
Some notes about upgrade to VS2017: when first modified and deployed (changed ConnectionString parameter only, without opening script) the same error occurred running locally, the server error reported the script was corrupted. After simply opening and closing the script (Edit Script, but no modification) the SSIS package appeared to see a change, requiring a save/rebuild; the package then ran okay locally, but after redeployment server reports the error noted in original post.
I will try undoing modifications to reintroduce the error running locally, see if I can trap an InnerException.

Reply with quote

Advertisement

You can post new topics in this forum