Looks good in a simple test program:
var sshCommand = client.CreateCommand("pwd");
var asynch = sshCommand.BeginExecute();
var reader = new StreamReader(sshCommand.OutputStream);
var errreader = new StreamReader(sshCommand.ExtendedOutputStream);
while (!asynch.IsCompleted)
{
var result = reader.ReadToEnd();
var error = errreader.ReadToEnd();
if (string.IsNullOrEmpty(result) && string.IsNullOrEmpty(error))
continue;
Console.WriteLine("StdErr: " + error);
Console.WriteLine("StdOut: " + result);
}
=>StdErr:
StdOut: /root