WinSCP不再在SSIS脚本任务中工作

时间:2017-07-21 20:21:20

标签: sql-server ssis sftp ssis-2012 winscp

我有一些现有的SSIS包,它们在脚本任务中使用WinSCP来使用SFTP发送/接收文件。

SSIS包现在在尝试执行脚本任务时抛出错误。调试器不可用,因为无法实例化脚本任务。

<style>
  td.legalCell{
    background-color: yellow;
    width: 1000px;
    height: 25px;
    border-bottom: solid;
  }

  th.legalTop{
    background-color: brown;
    width: 1000px;
    height: 150px;

    }
  }
</style>

<table>
  <thead>
  </thead>
    <th class="legalTop"></th>
  <tbody>
    <tr>
      <td class = "legalCell">
           CONTENTS             
      </td>
    </tr>
     <tr>
      <td class = "legalCell">
           CONTENTS             
      </td>
    </tr>
     <tr>
      <td class = "legalCell">
           CONTENTS             
      </td>
    </tr>
     <tr>
      <td class = "legalCell">
           CONTENTS             
      </td>
    </tr>
     <tr>
      <td class = "legalCell">
           CONTENTS             
      </td>
    </tr>
     <tr>
      <td class = "legalCell">
           CONTENTS             
      </td>
    </tr>
     <tr>
      <td class = "legalCell">
           CONTENTS             
      </td>
    </tr>
     <tr>
      <td class = "legalCell">
           CONTENTS             
      </td>
    </tr>
     <tr>
      <td class = "legalCell">
           CONTENTS             
      </td>
    </tr>
     <tr>
      <td class = "legalCell">
           CONTENTS             
      </td>
    </tr>
     <tr>
      <td class = "legalCell">
           CONTENTS             
      </td>
    </tr>
     <tr>
      <td class = "legalCell">
           CONTENTS             
      </td>
    </tr>
     <tr>
      <td class = "legalCell">
           CONTENTS             
      </td>
    </tr>
     <tr>
      <td class = "legalCell">
           CONTENTS             
      </td>
    </tr>
     <tr>
      <td class = "legalCell">
           CONTENTS             
      </td>
    </tr>
     <tr>
      <td class = "legalCell">
           CONTENTS             
      </td>
    </tr>
     <tr>
      <td class = "legalCell">
           CONTENTS             
      </td>
    </tr>
     <tr>
      <td class = "legalCell">
           CONTENTS             
      </td>
    </tr>
     <tr>
      <td class = "legalCell">
           CONTENTS             
      </td>
    </tr>
     <tr>
      <td class = "legalCell">
           CONTENTS             
      </td>
    </tr>
     <tr>
      <td class = "legalCell">
           CONTENTS             
      </td>
    </tr>
     <tr>
      <td class = "legalCell">
           CONTENTS             
      </td>
    </tr>
     <tr>
      <td class = "legalCell">
           CONTENTS             
      </td>
    </tr>
     <tr>
      <td class = "legalCell">
           CONTENTS             
      </td>
    </tr>
     <tr>
      <td class = "legalCell">
           CONTENTS             
      </td>
    </tr>
  </tbody>

</table>

在脚本编辑器中,代码分析工具(菜单&gt;构建&gt;运行代码分析...)会产生以下问题:

Error: Exception has been thrown by the target of an invocation.

我尝试用[ComVisible(false)]装饰类和Main方法,这些方法不起作用。

WinSCP不再使用SSIS 2012。

如何解决此问题?

1 个答案:

答案 0 :(得分:0)

您最好使用执行流程任务来处理WinSCP。 check the documetation from here

这对我来说也适用于SSIS 2012。

使用其他第三方.net库ex:Renci.SshNet更容易编写自己的SFTP任务。您可以在GitHub here

中找到完整的指南和示例项目