Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

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)


Topic review



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.

Issue - WinSCP. NET Assembly Product Version

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;