1
votes

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 no longer works using SSIS 2012.

How can I resolve this issue?

1
That issue does not seem to have anything to do with WinSCP. Can the task run, if you remove all WinSCP-related code? Show us minimal reproducible example. - Martin Prikryl

1 Answers

0
votes

You better to use execute process task to dealing with WinSCP. check the documetation from here

This worked for me for SSIS 2012 as well.

And its easier to write your own SFTP task, using other third party .net library ex: Renci.SshNet. You can find complete guide and sample project form GitHub here