From my script trying to connect to the unix server to download a file but getting below error..
Renci.SshNet.Common.SshConnectionException : Client not connected.
I can connect properly to that server from WinScp by using the same credentials.
Not sure what's going wrong here. Any idea/pointer ?
Code
using (var client = new ScpClient(Config.UnixServer, Config.UnixUsername, Config.UnixPassword))
{
client.Connect();
client.Upload(new FileInfo(fileUpload), fileName);
client.Disconnect();
}
Error
Renci.SshNet.Common.SshConnectionException : Client not connected.
at Renci.SshNet.Session.WaitOnHandle(WaitHandle waitHandle)
at Renci.SshNet.Session.Connect()
at Renci.SshNet.BaseClient.Connect()
Configsettings set correctly?