Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: User WinSCPnet.dll under Debian Buster

If I understand correctly, you are trying to use WinSCP on Linux machine. WinSCP is Windows application. It does not run on Linux (unless you use some Windows emulation like Wine, though I do not know if Wine can run .NET, probably it can).
https://winscp.net/eng/docs/library#purpose
Aimless

User WinSCPnet.dll under Debian Buster

Hi there,
so a while ago I wrote a script that connects to a SFTP- reads all Files from a directory
and then logs these to a database.
Now the server this is deployed to needed to be changed to a server running debian buster.
My code uses the WinSCPnet.dll in order to connect as well as read the files (and that always worked flawlessly under windows 10) however since i ported it to the new server, i keep on getting errors.
I included the .dll / exe via NuGet into my project and the WinSCP.exe as well as the WinSCPnet.dll are both inside the output folder.
Depending on how I create the session I get one of three errors:
1) Session session = new Session() //No executable Path, just fingerprint, ip, user, password
Error: The winscp.exe executable was not found at location of the assembly WinSCPnet (/home/user/programName),
nor the entry assembly {myDotNetAssembly} (/home/user/programName),
nor in an installation path.
You may use Session.ExecutablePath property to explicitly set path to winscp.exe.
2) Session session = new Session() { ExecutablePath = {Linux Path to executable}}
Error: The version of /home/user/ProgramName/WinSCP.exe () does not match version of this assembly /home/user/programName/WinSCPnet.dll (5.17.9.0).
When checking manually, they do have the version 5.17.9.0 though.
3) Open Session(sessionOptions) { ExecutablePath = ..., DisableVersionCheck = true }
Error: The named version of this synchronization primitive is not supported on this platform.

Please note that I changed the paths in the above code for privacy reasons, but rest assured they are correct in my release build.
Is this something I can fix somehow or do I need to rewrite my code to not use WinScpNet.dll anymore?

Thanks for any help in advance.