Topic "Issue - WinSCP. NET Assembly Product Version"

Author Message
[View user's profile]

Joined: 2012-01-24
Posts: 8
Location: Wrong Place - Wrong Time
Dll information:
Assembly/File Version:
Product Version

When attempting to execute the following code the WinSCP.exe shows the UI and generates the following C# project (Exception: "Timeout waiting for WinSCP to respond."). The ExecutablePath is pointing to the WinSCP.exe which came with the .dll that Martin posted. The code below is based on the code sample posted here (

Also, it still generates a bug if setting the session.ExeExecutablePath and not the session.ExecutablePath. The ExeExecutablePath does not seem to mentioned in the document here (

Thank you for the effort to develop this and I'll assist however I can.

All the best.

        public bool SetFileViaSFTP(string fullFileName, string hostName, string remotePath, string userName, string password, string sshHostKey)


                // Setup session options
                SessionOptions sessionOptions = new SessionOptions();
                sessionOptions.Protocol = Protocol.Sftp;
                sessionOptions.HostName = hostName;
                sessionOptions.UserName = userName;
                sessionOptions.Password = password;
                sessionOptions.SshHostKey = sshHostKey;
                using (Session session = new Session())
                    // Connect
                    session.ExecutablePath = WebConfigurationManager.AppSettings["WinSCPExePath"] + "WinSCP.exe";
                    // session.ExeExecutablePath = WebConfigurationManager.AppSettings["WinSCPExePath"] + "WinSCP.exe";

                    // Upload files
                    TransferOptions transferOptions = new TransferOptions();
                    transferOptions.TransferMode = TransferMode.Automatic;
                    TransferOperationResult transferResult;
                    transferResult = session.PutFiles(fullFileName, remotePath, false, transferOptions);

                    // Throw on any error

                    // Print results
                    foreach (TransferEventArgs transfer in transferResult.Transfers)
                        Console.WriteLine("Upload of {0} succeeded", transfer.FileName);


                return true;
            catch (Exception e)
                Console.WriteLine("Failure: {0}", e);

                return false;
[View user's profile]

Joined: 2012-01-24
Posts: 8
Location: Wrong Place - Wrong Time
This issue appears to have been related to a PEBKAC issue which has now been resolve through judicious application of electric shock therapy. Realized when checked that the download version posted here ( is the same Product Version but different Assembly/File Version ( Please excuse the oversight and let it be known the offending party (me) has a written mark on his record as a lesson to check for the latest in the future.

You can post new topics in this forum


What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License