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
3
votes
1 answer

Transfer of large number of files using SFTP is slow in C#

I am uploading 4000 zip files of size 85 KB of each using over Linux Server using SFTP in C# WPF application. This whole process takes 30 minutes. Is there any way to speed up the uploading using SFTP? I'm using WinSCP .NET…
dhiraj
  • 73
  • 2
  • 14
3
votes
1 answer

Does WinSCP .NET assembly support implicit TLS/SSL with client certificate authentication for FTPS?

Windows WinSCP application version 5.8.1 beta seems to support TLS/SSL client certificate authentication with implicit TLS/SSL for FTP. I wonder if WinSCP .NET assembly (dll version of WinSCP) supports this type of authentication?
Ahmet Arslan
  • 5,380
  • 2
  • 33
  • 35
3
votes
5 answers

How to remove "." and ".." files from remote directory with C# and WinSCP

I'm trying to get the files count from a remote directory using a SFTP connection, but I'm getting . and .. and these are counted these dots like a files, I have 2 files in the remote directory but is counting 4 files including . and ... Someone can…
Javier Salas
  • 1,064
  • 5
  • 15
  • 38
3
votes
1 answer

How to get key fingerprint for SFTP from private key?

As I am working on a .NET C# project which uses WinSCP .NET assembly, for SFTP password less connection. By far I have made an UI where we have to provide SSH key fingerprint, paraphrase, and path of .ppk file. My question is that, is there any way…
Pranay Deep
  • 1,371
  • 4
  • 24
  • 44
3
votes
2 answers

Using the WinSCP NuGet Package (and git), can I add WinSCP.exe to my git ignore?

C# / Visual Studio: Part of the installation of the WinSCP NuGet package includes adding WinSCP.exe to my project root. (While I'm not entirely happy with that location in my project, that's not my question). If I don't need to, I'd rather not have…
jack
  • 303
  • 3
  • 12
3
votes
1 answer

Unrequested debugging Info in Powershell console

I'm having a nuisance issue I'd like to eliminate where I get debugging info I am not asking for in a Powershell console and ISE. It's a nuisance in that it gets in the way of my desired debugging info. I'm not clear if this is specific to the tool…
dave_the_dev
  • 1,555
  • 3
  • 15
  • 27
3
votes
1 answer

File being used by another process error

Can anyone tell me how to get rid of the error The process cannot access the file because it is being used by another process Here is my code if (!File.Exists(FlagFilePath)) { Debug.WriteLine("Trying to download sales data file "); …
user3754674
  • 105
  • 2
  • 9
3
votes
3 answers

PowerShell to use WinSCP .NET assembly with secure credentials

I'm trying to use WinSCP .NET assembly with secure credential, when the password secured in external file. # Load WinSCP .NET assembly Add-Type -Path "D:\WinSCPnet.dll" # Setup session options $sessionOptions = New-Object…
yaniv
  • 31
  • 1
  • 4
3
votes
2 answers

WinSCP and defined port

I am trying to connect to our ftp using WinSCP. But how can i define a port in PowerShell using the .net assembly! I am trying to make a solution where I download the recent files from the server, delete it on the server and then import it to a…
Kwire
  • 107
  • 1
  • 4
  • 12
3
votes
1 answer

WinSCP .NET assembly - How to set folder permissions after creating directory?

I'm building a web site and I want that when a user registers, to create a directory on the SFTP server and put in that directory a new file I'm using WinSCP .NET assembly, and writing C#. I noticed that you are able to set permissions only in the…
ro-E
  • 279
  • 1
  • 5
  • 16
3
votes
1 answer

How to move/rename file using WinSCP .NET Assembly when target file exist already?

I'm developing SFTP file transferring project using WinSCP .NET Assembly (C#). I want to move files in server. Here is the code: session.MoveFile(server.RemoteDownloadPath + fileInfo.Name, server.DoneFilePath); Console.WriteLine("Move File {0} to…
Suravi
  • 301
  • 1
  • 7
  • 21
3
votes
1 answer

WinSCP .NET assembly open stored session

How can I use the .NET assembly provided by WinSCP to open a stored session created from the WinSCP application?
3
votes
1 answer

WinSCP .NET Assembly throws "The module was expected to contain an assembly manifest"

I am trying to use the WinSCP within my C# project for some ftp automation. I am using Visual Studio 2012 and am unsure on how to get it to work. Things I have done so far: I copied the WinSCP.exe into my project folder. I imported a reference to…
Ishikawa
  • 658
  • 1
  • 6
  • 14
3
votes
0 answers

"Can't get attributes of file" error when downloading file using WinSCP .NET assembly

I am working with WinSCP .NET library to transfer files from Linux to Windows. I have a code but files are not getting downloaded. Can someone look into this code and see what am I doing wrong. In my view some problem is occurring in code line…
Kamal Sharma
  • 61
  • 1
  • 6
2
votes
1 answer

WinSCP.SessionLocalException: The winscp.exe executable was not found at location of the assembly WinSCPnet

I am new working in a lab that sends data from a local computer to an HPC. I have been all day working around the following problem I am not familiar with it at all. 4/19/2022 3:21:28 PM ERROR: WinSCP.SessionLocalException: The winscp.exe executable…