command ran against Cisco C200 hangs

Sep 28, 2011 at 1:55 AM

I am using the following code, pretty simple, to connect to a Cisco C200

using (var client = new SshClient("", "admin", "password"))
                var cmd = client.RunCommand(@"show version");
                string temp = cmd.Result;

I can putty to the C200 and issue command fine with the following output

ucs-c200-m1# show version
Firmware Version

For some reason when i reach "var cmd = client.RunCommand(@"show version");"  code just hangs?????

i can connect to any other Cisco equipment fine. here is the config of SSH on the C200

ucs-c200-m1 /ssh # show detail
    ssh-port: 22
    timeout: 1800
    max-sessions: 4
    session-count: 1
    enabled: yes

ucs-c200-m1 /ssh #

Funny thing is, i can use the older SHARP SSH , which SSH.NET is based upon and I am able to connect and run the following code from SHARP SSH:

      //create a new ssh stream
            SshStream ssh = new SshStream("", "admin", "password");

            //set the end of response matcher character
            ssh.Prompt = "#";
            //remove terminal emulation characters
            ssh.RemoveTerminalEmulationCharacters = true;
            //writing to the ssh channel
             ssh.Write("show version");
            //reading from the ssh channel
            string response = ssh.ReadResponse();

However, this only returns the prompt "ucs-c200-m1# " not the output from the command so it still not wokring 100% either.... but with the SHARP SSH API i am able to determine SSH running on C200 as :


So , not sure if that helps either... I don't know what else to do on this any help appreciated????