<p>I have found an issue using the SshClient when I try to execute multiple commands such as changing directories followed by execution operation (e.g "cd program files\\Smart tools & start Reboot.exe /r") it crashes my application. Here is a copy of a function from my code to give you an idea of the tasks I am trying to perform.</p>
<p> </p>
<p>public void RebootDevice() {</p>
<p> </p>
<p> using (var devcon = new SshClient(_deviceaddr, "user", new PrivateKeyFile("local.key")))</p>
<p> { </p>
<p> devcon.Connect(); </p>
<p> SshCommand DevCommand = devcon.CreateCommand("cd program files\\Smart tools & start Reboot.exe /r");</p>
<p> try</p>
<p> {</p>
<p> DevCommand.Execute();</p>
<p> }</p>
<p> catch</p>
<p> { throw new Exception("Command Failed");</p>
<p> }</p>
<p> devcon.Disconnect();</p>
<p> } </p>
<p> }</p>
<p> </p>
<p> </p>
<p>This command (cd program files\\Smart tools & start Reboot.exe /r ) performs the actions of changing the directory and executing reboot.exe perfectly in the shell enviroment but the SshClient execute function freezes my application and I have to kill the process when ever i try to perform this action from the code. Do you have any suggestions or fixes to this issue?</p>
Comments:
<p> </p>
<p>public void RebootDevice() {</p>
<p> </p>
<p> using (var devcon = new SshClient(_deviceaddr, "user", new PrivateKeyFile("local.key")))</p>
<p> { </p>
<p> devcon.Connect(); </p>
<p> SshCommand DevCommand = devcon.CreateCommand("cd program files\\Smart tools & start Reboot.exe /r");</p>
<p> try</p>
<p> {</p>
<p> DevCommand.Execute();</p>
<p> }</p>
<p> catch</p>
<p> { throw new Exception("Command Failed");</p>
<p> }</p>
<p> devcon.Disconnect();</p>
<p> } </p>
<p> }</p>
<p> </p>
<p> </p>
<p>This command (cd program files\\Smart tools & start Reboot.exe /r ) performs the actions of changing the directory and executing reboot.exe perfectly in the shell enviroment but the SshClient execute function freezes my application and I have to kill the process when ever i try to perform this action from the code. Do you have any suggestions or fixes to this issue?</p>
Comments:
Old issue
Freeze should be resolve if not please let me know.