Re: exception
Ok, so can you please post a callstack of actual exception you get?
[2012-03-28 08:59:23Z] [0001] Failed: [WinSCP.SessionRemoteException: Authentication failed.]
[2012-03-28 08:59:37Z] [0001] Exception: WinSCP.SessionRemoteException: Authentication failed.
at WinSCP.SessionLogReader.Read(LogReadFlags flags)
at WinSCP.ElementLogReader.Read(LogReadFlags flags)
at WinSCP.CustomLogReader.TryWaitForNonEmptyElement(String localName, LogReadFlags flags)
at WinSCP.CustomLogReader.WaitForNonEmptyElement(String localName, LogReadFlags flags)
at WinSCP.CustomLogReader.WaitForNonEmptyElementAndCreateLogReader(String localName, LogReadFlags flags)
at WinSCP.CustomLogReader.WaitForGroupAndCreateLogReader()
at WinSCP.Session.Open(SessionOptions sessionOptions)
[2012-03-28 08:59:37Z] [0001] Session.Cleanup entering
[2012-03-28 08:59:37Z] [0001] Command: [exit]
There is an exception stack trace near the end of the winscpdebug-first.txt (and the other debug log). The debug trace says 'SessionRemoteException' but at runtime the exception that escapes the call is an IO exception: Access Denied, when trying to reopen a temporary file.
For the WinSCP.EXE issue: I can't set a password as it is a public FTP site and including a password will fail authentication.
# This Fails
open ftp://wireless.fcc.gov
# This Works
open ftp://anonymous:@wireless.fcc.gov
var options = new WinSCP.SessionOptions() {
FtpSecure = WinSCP.FtpSecure.None
, HostName = "wireless.fcc.gov"
, Protocol = WinSCP.Protocol.Ftp
};
WinSCP.Session session = new WinSCP.Session() {
ExecutablePath = Path.Combine(Environment.CurrentDirectory, "SftpTools", "WinSCP.exe")
};
session.Open(options);