The constructor for SftpClient and SshClient class throws an ArgumentException when the hostname has an underscrore character '_' . Using disassembly I can find the issue is the regex _rehost in Extensions.cs
This regex should be fixed as _ is valid hostname.
Comments: ** Comment from web user: StephenMills **
This regex should be fixed as _ is valid hostname.
Comments: ** Comment from web user: StephenMills **
I ran into this as well. I agree it should be fixed as DNS does allow you to use _ in a hostname. You aren't supposed to use it, which is probably why the restriction was put in, but it does actually allow it. So please fix this, as I can't use this very well right now and it is otherwise very useful.
Thanks.