Ram,
You might raise this issue with the maintainers of the SSH library you are using, since it is not specific to Blue Prism as you stated. When a code block works in Visual Studio, you can reasonably expect it to work in Blue Prism.
That said, there are a couple of areas you might check:
1. Does your server have any logs reporting the specifics of the connection error?
2. Can you connect via SSH using a tool like Putty?
3. Is your host key algorithm compatible? Check the key algorithm used by the server and see if it is compatible with the SSH library. I believe, with SSH.NET, there are cases where some key algorithms are simply incompatible currently. The developers of SSH.NET would be of the most guidance in that scenario.
------------------------------
Charlie Kovacs
Sr. Digital Exchange Engineer
Blue Prism
Austin, USA
------------------------------
Charlie Kovacs