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.

Options
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)

Options

Topic review

rohitbd

Getting "timeout waiting for external console to complete"

Hello,

We are using WinSCP .NET DLL and the WinSCP.exe for SFTP transfers in our .NET project. We get the "timeout waiting for external console to complete" error box despite using the WinSCP .NET wrapper DLL. On your support documentation it is mentioned that the best way to avoid getting that error is to use the wrapper.

The WinSCP.exe version info is as follows:
File Version: 5.5.6.4746
Product Version: 5.5.6.0

Please help us resolve the issue - we have even tried increasing the time out to 24 hours as the code below shows. The following is the code snippet that does the file transfer:

string[] sftpConfig = configHelper.SFTPConfiguration; //Our internal config object


string sftpUrl = sftpConfig[0];
string sftpPort = sftpConfig[1];
string sftpUser = sftpConfig[2];
string sftpPass = sftpConfig[3];
TimeSpan timeoutFTP = new TimeSpan(24, 0, 0, 00, 0);

SessionOptions sessionOptions = new SessionOptions
{
    Protocol = Protocol.Sftp,
    HostName = sftpUrl,
    UserName = sftpUser,
    Password = sftpPass,
    Timeout = timeoutFTP,
    SshHostKeyFingerprint = "ssh-rsa 2048 7e:8b:ae:0b:89:b2:a1:f7:43:ce:ab:fe:4e:8f:f4:13"
};

int portNumber;

if(int.TryParse(sftpPort, out portNumber))
{
    sessionOptions.PortNumber = portNumber;
}

using (Session session = new Session())
{
    // Connect
    session.DisableVersionCheck = true;
    session.Open(sessionOptions);

    // Upload files
    TransferOptions transferOptions = new TransferOptions();

    transferOptions.TransferMode = TransferMode.Binary;
    transferOptions.ResumeSupport.State = TransferResumeSupportState.On;

    TransferOperationResult transferResult;

    string path = string.Format("{0}\\*.bin", configHelper.SaveLocation);

    transferResult = session.PutFiles(path, ConfigurationManager.AppSettings["FTPFolderLocation"], false, transferOptions);

    transferResult.Check();

    foreach (TransferEventArgs transfer in transferResult.Transfers)
    {
        //Here we check the Transfer.FileName to move successfully transferred
        //files to archive location
    }
}