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
16
votes
5 answers

PowerShell: Unable to find type when using PS 5 classes

I'm using classes in PS with WinSCP PowerShell Assembly. In one of the methods I'm using various types from WinSCP. This works fine as long as I already have the assembly added - however, because of the way PowerShell reads the script when using…
dbso
  • 636
  • 1
  • 5
  • 14
14
votes
5 answers

PowerShell runtime exception - "could not load file or assembly"

This seems to be a common problem in PowerShell and Visual Studio, yet cases and solutions seem to vary a lot. Though seeing several similar questions, I didn't find a working solution for my issue yet. The problem exists in the error message Could…
Mark Jenster
  • 503
  • 3
  • 6
  • 18
12
votes
5 answers

SSH host key fingerprint does not match pattern C# WinSCP

I am trying to connect to an FTPS server using C# via WinSCP and I am getting this error: SSH host key fingerprint ... does not match pattern ... After tons of research, I believe is has something to do with the length of the key. The key I got…
user3690095
8
votes
1 answer

WinSCP .NET assembly: Where to define proxy?

I am able to define the proxy server by using the WinSCP GUI. If I do this I am able to connect to a remote host. But in code I don't find a way to declare the proxy server for WinSCP. In this case I receive Remote server returned an error (407)…
deyaert
  • 101
  • 1
  • 3
6
votes
1 answer

Method not found exception (EventWaitHandle..ctor) using WinSCP .NET

I am trying to connect to SFTP server using PowerShell, and using WinSCP .NET assembly. Code is not able to open the session ($session.Open($sessionOptions)). In the logs I found, Exception: System.MissingMethodException: Method not found: 'Void…
Ktn Patel
  • 141
  • 1
  • 6
6
votes
2 answers

WinSCP .NET assembly in PowerShell - Creating SessionOptions - The value supplied is not valid, or the property is read-only

I'm trying to automate the transfer of files with WinSCP using PowerShell. I've installed .NET assembly. In the code I've added, I've taken out credentials and hostname for privacy and I'm also using the full path to WinSCPnet.dll. Here is the error…
CrashleyS
  • 111
  • 3
  • 12
6
votes
2 answers

WinSCP .NET assembly refusing RSA/DSA key fingerprint

I am trying to connect up to a WinSCP server using the WinSCP .NET assembly. The problem I am having is that it bombs checking the host key fingerprint. I have created a RSA key. My code is as follows: var server = new…
Jim
  • 149
  • 2
  • 11
6
votes
4 answers

WinSCP: How to make sure SFTP upload gets renamed from .zip.filepart to .zip?

Using the .NET assembly of WinSCP to upload a file. OperationResultBase.Check() is throwing the following error: WinSCP.SessionRemoteException: Transfer was successfully finished, but temporary transfer file 'testfile.zip.filepart' could not be…
sigil
  • 9,370
  • 40
  • 119
  • 199
5
votes
1 answer

"Upload of file '...' was successful, but error occurred while setting the permissions and/or timestamp" when using WinSCP .NET assembly in PowerShell

Exception calling "Check" with "0" argument(s): "Upload of file '2019-06-11.zip' was successful, but error occurred while setting the permissions and/or timestamp. If the problem persists, turn off setting permissions or preserving…
user3542587
  • 313
  • 1
  • 4
  • 13
5
votes
2 answers

WinSCP .NET assembly: How to download directories

I wrote a application in C# that uses System.IO.GetDirectoires() and System.IO.GetFiles() I now have to convert that to use SFTP. I have experience with PutFiles and GetFiles of WinSCP .NET assembly, but I cannot figure out how to get a list of…
user3753693
  • 225
  • 1
  • 5
  • 13
5
votes
3 answers

WinSCP SFTP connection error

While accessing my remote server, from SFTP, I am constantly getting this error Connection has been unexpectedly closed. Server sent command exit status 0 I have filled same credentials in WinSCP, it is working fine. Where am I lacking? Also,…
Pranay Deep
  • 1,371
  • 4
  • 24
  • 44
5
votes
1 answer

Access remote file contents as a stream using WinSCP .NET assembly

I am trying to open file to read from SFTP using WinSCP .NET assembly as par to my exercise to archive file from SFTP to Azure blob. To upload a blob to Azure, I am using using (var fileStream = inputStream) { …
Mukil Deepthi
  • 6,072
  • 13
  • 71
  • 156
5
votes
1 answer

WinSCP .NET assembly throwing "The winscp.exe executable was not found at location of the assembly" when installed to GAC for SSIS

I have a package which downloads files from FTP using WinSCP which runs perfectly when I execute it locally. But we are facing issues when we run from the deployed version from SSIS DB Catalog. GAC registration already done for the .dll file. Below…
Prakazz
  • 421
  • 1
  • 8
  • 21
5
votes
1 answer

File upload with WinSCP .NET/COM with temporary filenames

I am creating a small .NET application in C# to upload files to an FTP Server. I am using the .NET DLL for WinSCP while doing this and i have been trying to find a good solution to my problem. The FTP folder where I will put all my files will be…
Arto Uusikangas
  • 1,889
  • 5
  • 20
  • 33
5
votes
1 answer

How to upload files to home using WinSCP .NET assembly?

I want to upload files to home (root) directory of the server, not into a folder. How can I do it? (using C#) transferResult = session.PutFiles(path, "\\", true, transferOptions); If I use \\ for remotePath, uploaded file was renamed.
Suravi
  • 301
  • 1
  • 7
  • 21
1
2 3
22 23