Dll cannot initialize external console.
I have a block of code that uploads a txt file to remote SFTP.
However, I am getting the below error.
WinSCP.SessionRemoteException: Cannot initialize external console. at WinSCP.SessionLogReader.Read(LogReadFlags flags) at WinSCP.ElementLogReader.Read(LogReadFlags flags) at WinSCP.SessionElementLogReader.Read(LogReadFlags flags) at WinSCP.CustomLogReader.TryWaitForNonEmptyElement(String localName, LogReadFlags flags) at WinSCP.CustomLogReader.WaitForGroupAndCreateLogReader() at WinSCP.Session.Open(SessionOptions sessionOptions) at XMLPostoverFTP.Class1.getFTP()
This is the block of code-
SessionOptions sessionOptions = new SessionOptions
{
Protocol = Protocol.Sftp,
HostName = "sftpimfs.ironmountain.com",
UserName = "Zuza",
Password = "frYG2CY9",
PortNumber = 22,
SshHostKeyFingerprint = "ssh-rsa 2048 a8:4c:12:ef:2f:29:c0:62:b7:37:5c:d4:73:0a:55:7b"
};
using (Session session = new Session())
{
session.ExecutablePath = null;
session.SessionLogPath = null;
session.Open(sessionOptions);
TransferOptions transferOptions = new TransferOptions();
transferOptions.TransferMode = TransferMode.Binary;
transferOptions.FilePermissions = null; //Permissions applied to remote files;
transferOptions.PreserveTimestamp = false; //Set last write time of
//destination file to that of source file - basically change the timestamp
//to match destination and source files.
transferOptions.ResumeSupport.State = TransferResumeSupportState.Off;
TransferOperationResult transferResult;
transferResult = session.PutFiles("/ZUZAUpload.txt", "/Outbox/", false, transferOptions);
transferResult.Check();
}
Would be great to get some help, on where am I going wrong.
Thanks[/i]
However, I am getting the below error.
WinSCP.SessionRemoteException: Cannot initialize external console. at WinSCP.SessionLogReader.Read(LogReadFlags flags) at WinSCP.ElementLogReader.Read(LogReadFlags flags) at WinSCP.SessionElementLogReader.Read(LogReadFlags flags) at WinSCP.CustomLogReader.TryWaitForNonEmptyElement(String localName, LogReadFlags flags) at WinSCP.CustomLogReader.WaitForGroupAndCreateLogReader() at WinSCP.Session.Open(SessionOptions sessionOptions) at XMLPostoverFTP.Class1.getFTP()
This is the block of code-
SessionOptions sessionOptions = new SessionOptions
{
Protocol = Protocol.Sftp,
HostName = "sftpimfs.ironmountain.com",
UserName = "Zuza",
Password = "frYG2CY9",
PortNumber = 22,
SshHostKeyFingerprint = "ssh-rsa 2048 a8:4c:12:ef:2f:29:c0:62:b7:37:5c:d4:73:0a:55:7b"
};
using (Session session = new Session())
{
session.ExecutablePath = null;
session.SessionLogPath = null;
session.Open(sessionOptions);
TransferOptions transferOptions = new TransferOptions();
transferOptions.TransferMode = TransferMode.Binary;
transferOptions.FilePermissions = null; //Permissions applied to remote files;
transferOptions.PreserveTimestamp = false; //Set last write time of
//destination file to that of source file - basically change the timestamp
//to match destination and source files.
transferOptions.ResumeSupport.State = TransferResumeSupportState.Off;
TransferOperationResult transferResult;
transferResult = session.PutFiles("/ZUZAUpload.txt", "/Outbox/", false, transferOptions);
transferResult.Check();
}
Would be great to get some help, on where am I going wrong.
Thanks[/i]