This project is read-only.

ShellStream and .NET Debugging

Sep 26, 2012 at 12:37 AM

Hi,

I'm having a weird problem with ShellStream and would appreciate some insight.

I'm connecting to a cisco router and I'm able to execute commands and receive the results using the ShellStream class in the runtime. I can call Write/Read multiple times in a row and it works just fine.

Once I add a breakpoint to the application and pause the execution, I try to use the exact same command it ran multiple times from the Immediate window, and the stream doesn't seem to be "working" anymore.

I see the stream open, I can write to it, but the Read() always returns an empty string, doesn't matter how many times I try to call Read().

Is there anything that prevents using the ShellStream after using breakpoints?

Thanks in advance,

Natan

Sep 27, 2012 at 11:49 AM

Hi Natan,

I'm not an owner of this library but I noticed your post and perhaps I could give you a clue how you can debug it.

As far as I discovered, SshNet library uses async pattern and when your code hits the breakpoint, another task running on different thread could finish an execution.

Check this website:

http://www.danielmoth.com/Blog/parallel-debugging.aspx

It should give you at least a good introduction to Parallel\Async debugging.

 

Regards,