What version of SSH.NET are you using ?
Can you verify whether SshClient.IsConnect is still true after the exception ?
Also try subscribing to the Exception event to learn more on the reason why the connection was dropped:
Can you verify whether SshClient.IsConnect is still true after the exception ?
Also try subscribing to the Exception event to learn more on the reason why the connection was dropped:
using (var client = new SftpClient(...))
{
client.ErrorOccurred += (sender, args) => Console.WriteLine(args.Exception);
client.Connect();
...
}