.NET assembly log file says User name: (Password: No, Key file: No, Passphrase: No)
This is the continuation of my last topic. The user name and password are provided. When I run the process in VS debugger I see it work. I put the process in production and tells me no user name or password. In the debugger, I stop it just after
sessionOptions
is created and populated. Hovering over these variables shows the correct values. The WriteToLog
method of course writes whatever to the program log file. Looking in there after the code finishes shows a blank line. The session.Open
statement is where things fall apart.
// Setup session options SessionOptions sessionOptions = new SessionOptions { Protocol = Protocol.Ftp, FtpSecure =FtpSecure.Implicit, HostName = sHostName, UserName = sUserName, Password = sPassword }; using (Session session = new Session()) { session.SessionLogPath = "c:\\AKH\\WinSCP.log"; WriteToLog(sessionOptions.UserName + " " + sessionOptions.Password); // Connect session.Open(sessionOptions); // Download files TransferOptions transferOptions = new TransferOptions(); transferOptions.TransferMode = TransferMode.Binary;