Broken reference when trying to use SSH.NET NuGet package to get connected to an SFTP site using an SSIS job

150 Views Asked by At

I have struggled for the past two weeks to connect to a SFTP site that uses a public and private key in a SSIS job so that I can retrieve a file and do some conversions and move it to a local network drive.

The person that has wrote most of our complicated jobs that have done that has left and so trying to fill in the void to do this but I can't follow her past jobs. I do not have any fancy modules in Visual Studio SSIS. I'm trying to do this using a script task as that is the only way I have found online. I have also asked ChatGPT but now I think I have a issue with my VS instance but I do not know.

So, from what I can find out I should import a SSH module so that I can connect to an SFTP site. I tried installing Renci.SshNet.

Pick of Install Module in Nuget

I had a success install, it's in my references and I can import it with no error.

pic of references used

#Region "Imports"
Imports System
Imports System.Data
Imports System.Math
Imports Microsoft.SqlServer.Dts.Runtime
Imports System.IO
Imports System.Text
Imports Renci.SshNet
#End Region 

The moment I save and close I get 0 errors.
No Error Script Task

Now I go back in and check edit my script I get some unexpected errors.

I get a new Green error on my imports over Renci.

weird green error
Weird yellow error

I don't know what happened,

.NET framework I'm on is 4.7.

Any suggestions would be helpful.

I will say, I know that there are better ways to do what I am asking but trying to use SSIS. I was able to do all these steps by using Python paramiko, re, shutil, os and threadpoolexecutor.

1

There are 1 best solutions below

1
Martin Prikryl On

Afaik, unless something changed recently, using NuGet in SSIS is not possible or unreliable. You should rather register the assembly to GAC: