title: SshConnectionException from SshNet in C#
body: <p>From my script trying to connect to the unix server to download a file but getting below error..</p>
  
  <blockquote>
    <p>Renci.SshNet.Common.SshConnectionException : Client not connected.</p>
  </blockquote>
  
  <p>I can connect properly to that server from WinScp by using the same credentials.</p>
  
  <p>Not sure what's going wrong here. Any idea/pointer ?</p>
  
  <p><strong>Code</strong></p>
  
  <pre><code>using (var client = new ScpClient(Config.UnixServer, Config.UnixUsername, Config.UnixPassword))
  {
      client.Connect();
      client.Upload(new FileInfo(fileUpload), fileName);
      client.Disconnect();
  }
  </code></pre>
  
  <p><strong>Error</strong></p>
  
  <pre><code>Renci.SshNet.Common.SshConnectionException : Client not connected.
  at Renci.SshNet.Session.WaitOnHandle(WaitHandle waitHandle)
  at Renci.SshNet.Session.Connect()
  at Renci.SshNet.BaseClient.Connect()
  </code></pre>
  
  <p><a href="https://www.dropbox.com/s/adhvdi5llq3tk53/20170914AUTO-user%40host.log?dl=0" rel="nofollow noreferrer">WinSCP Session Log</a></p>