Post a reply

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


Found the issue, the issue was that winscp .net library version didn't match winscp.exe version, reinstalled from scratch and it worked.

Element "cwd" not found in the log file


I've got the same exception when trying to synchronize directories. I was using Server! server and the following code to sync dirs:
                var sessionOptions = new SessionOptions

                    Protocol = Protocol.Sftp,
                    HostName = _settingsService.GetValue((SFTPSettings s) => s.InboundHost, string.Empty),
                    UserName = _settingsService.GetValue((SFTPSettings s) => s.InboundUsername, string.Empty),
                    Password = _settingsService.GetValue((SFTPSettings s) => s.InboundPassword, string.Empty),
                    SshHostKeyFingerprint = _settingsService.GetValue((SFTPSettings s) => s.InboundSshHostKeyFingerprint, string.Empty)
                SynchronizationResult result;
                using (var session = new Session {ExecutablePath = _winScpPath, DisableVersionCheck = true})

                    result = session.SynchronizeDirectories(SynchronizationMode.Local, localFolderPath,
                        folderPath, removeFiles: true);


I used standard SFTP server settings and added all required permissions to the user.

Re: Element "cwd" not found in the log file

Can you post the logs using the latest version of WinSCP?

Error: {0}WinSCP.SessionLocalException: Element "cwd" not found in the log file
at WinSCP.CustomLogReader.WaitForNonEmptyElement(String localName, LogReadFlags flags)
at WinSCP.CustomLogReader.WaitForNonEmptyElementAndCreateLogReader(String localName, LogReadFlags flags)
at WinSCP.Session.Open(SessionOptions sessionOptions)
at F5_Add.Add.WinSCP(String source, String dest) in c:\Users\mkozak\Documents\Visual Studio 2013\Projects\F5 Add\F5 Add\Add.cs:line 1806

Can you post a callstack of the extension?

Element "cwd" not found in the log file

Trying to upload a file I get this error message on session.Open(sessionOptions);

I've attached the log files.

SessionOptions sessionOptions = new SessionOptions
Protocol = Protocol.Sftp,
HostName = "virt01",
UserName = "root",
Password = "mypassword",
PortNumber = 22,
SshHostKeyFingerprint = "ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx"

// Connect
session.DebugLogPath = Environment.GetEnvironmentVariable("USERPROFILE") + "\\AppData\\Local\\Commander\\DebugLogPath.txt";
session.SessionLogPath = Environment.GetEnvironmentVariable("USERPROFILE") + "\\AppData\\Local\\Commander\\SessionLogPath.txt";
session.DisableVersionCheck = true;