Questions tagged [winscp-net]

The WinSCP .NET assembly (winscpnet.dll) is a .NET wrapper around WinSCP's scripting interface that allows your code to connect to a remote machine and manipulate remote files over SFTP, FTP, WebDAV and SCP sessions from .NET languages, such as C#, VB.NET, and others, or from environments supporting .NET, such as PowerShell and SQL Server Integration Services (SSIS).

The WinSCP .NET assembly winscpnet.dll is a .NET wrapper around WinSCP's scripting interface that allows your code to connect to a remote machine and manipulate remote files over SFTP, FTP, WebDAV and SCP sessions from .NET languages, such as C#, VB.NET, and others, or from environments supporting .NET, such as PowerShell and SQL Server Integration Services (SSIS).

For details see:

The assembly is also exposed to COM, and as such it can be used from variety of other programming languages and development environments--e.g., WSH-hosted active scripting languages like JScript and VBScript, Visual Basic for Applications (VBA), Perl, and Python.

For details see:

The library is primarily intended for advanced automation tasks that require conditional processing, loops or other control structures for which the basic scripting interface is too limited. The library is not a general purpose file transfer library. It particularly lacks support for interactive processing and as such it is not well suited for use in GUI applications.

Use tag for all WinSCP related questions, along with .

339 questions
5
votes
2 answers

"No supported authentication methods available" while connecting to SFTP using WinSCP in C#

I'm trying to connect to a SFTP server using WinSCP in C#. This is my code: SessionOptions sessionOptions = new SessionOptions { Protocol = Protocol.Sftp, HostName = "ip", PortNumber = portNR, UserName = "username", Password =…
Lahib
  • 1,305
  • 5
  • 34
  • 62
4
votes
1 answer

How to download a single file using Session.GetFiles in WinSCP C#

So, basically I am trying to download only one file from the entire folder on my server. Folder "domain" contains those files right now: File1.txt File2.txt File3.txt So, as I can see in WinSCP docs if I want to download only one file I still…
Stas Mackarow
  • 175
  • 2
  • 5
  • 16
4
votes
1 answer

How to fix NuGet WinSCP.NET in SSIS Script Task?

I'm trying to use the WinSCP.NET NuGet to upload some files to an SFTP through a Script Task component in SSIS. While writing the code everything went fine, but if after attempting to build, the WinSCP.NET dll seems to not be picked up breaking all…
Kross
  • 305
  • 3
  • 21
4
votes
2 answers

PowerShell SFTP Download without Writing Files to Disk

I am trying to use PowerShell to Sync Payroll files stored on SFTP to SharePoint. I have most of the code written, the only thing I can't figure out is if there is a way to avoid temporarily downloading the file to the disk. Given the sensitivity of…
Eric Weintraub
  • 967
  • 1
  • 10
  • 23
4
votes
1 answer

How do I use DTS.Events.FireInformation() in SSIS Script Task while handling WinSCPnet.dll FileTransferProgress?

I have a Script Task in an SSIS (2008) package that downloads files from a remote FTP server to a local directory. The Script Task is written in C# 2008, and uses WinSCPnet.dll. Using examples from WinSCP's documentation, I came up with the script…
digital.aaron
  • 5,435
  • 2
  • 24
  • 43
4
votes
2 answers

Code to download file from FTP with WinSCP .NET assembly does not connect, but I can connect in WinSCP GUI

I need to download a file from FTP thru WinSCP .NET assembly. I have this code currently but the error says Authentication failed. try { SessionOptions sessionOptions = new SessionOptions { Protocol = Protocol.Ftp, HostName…
theo
  • 279
  • 1
  • 3
  • 17
4
votes
1 answer

Sending files over FTPS (secure) using WinSCP .NET assembly

What is required to send out files to a server with WinSCP (.NET assembly) using FTPS (Secure)? I've been looking at their documentation and am not really clear on certain aspects like TlsHostCertificateFingerprint or TlsClientCertificatePath.…
Newbie
  • 157
  • 4
  • 15
4
votes
1 answer

WinSCP .NET assembly SynchronizeDirectories: Upload of file ... was successful, but error occurred while setting the permissions and/or timestamp

I am using WinSCP .NET Assembly in PowerShell for file synchronization with a SFTP server. I am using the following code for synchronization: http://winscp.net/eng/docs/library_session_synchronizedirectories#powershell Problem is, when this script…
cloudify
  • 95
  • 4
  • 10
4
votes
3 answers

SSIS C# 2012 Script Task referring WinSCPnet.dll fails when run from SQL Server Agent with "Exception has been thrown by the target of an invocation"

I have an SSIS package (created in VS 2013) that contains a C# 2012 Script Task. The job of the script task is to download a file from an SFTP server using WinSCP .NET assembly and place it on my server (Windows Server 2012 R2 with SQL Server…
4
votes
1 answer

WinSCP .NET assembly - Remove files (not directories) after GetFiles

I'm trying to download files from a big tree of recursive directories, and I want the downloaded files to be removed after download. When I put true in remove parameter of GetFiles, it removes all the directories, but I want it to remove only the…
user5441417
  • 101
  • 3
  • 9
4
votes
1 answer

WinSCP .NET library: Connect to SFTP server without specifying SSH host key fingerprint

In the current stable release of WinSCP, it seems that using SshHostKeyFingerprint is mandatory and there are no ways to connect to SFTP server without that in SessionOptions. I can see that the ability to bypass is added to the beta (5.2) but I was…
user446923
  • 553
  • 1
  • 10
  • 20
4
votes
2 answers

Why does FileZilla work without knowing any keys, but WinSCP doesn't?

I got the connection details of a SFTP server, connected to it with FileZilla, and then successfully downloaded a file from that SFTP. The only details I had was host, port, user and pass. Now I'm trying to connect to this same server trough WinSCP…
Michiel Cornille
  • 2,067
  • 1
  • 19
  • 42
3
votes
1 answer

C# save WinSCP stream to Azure Blob Storage Error: Offsets with value of non-zero are not supported

I am trying to save a file downloaded from an SFTP site using the WinSCP .NET library, and then save it Azure Blob storage. I don't want to use CloudBlobContainer as it is deprecated. I keep getting the error message: Offsets with value of…
laney
  • 57
  • 9
3
votes
1 answer

Using WinSCP .NET assembly on Linux

I have deployed my application based on WinSCP .NET assembly in Linux. I'm getting this error: WinSCP.SessionLocalException: The winscp.exe executable was not found at the location of the assembly WinSCPnet SessionOptions sessionOptions = new…
3
votes
2 answers

WinSCP AddRawSettings FSProtocol

When generating the C# code from the WinSCP GUI, I get sessionOptions.AddRawSettings("FSProtocol", "2"); Does anyone know what this FSProtocol setting and the value "2" means? I tried to google "FSProtocol" but fail to get any result specific to…
Aleen Shr
  • 39
  • 3
1
2
3
22 23