As this is the top answer for that error message, so I think it’s worthwhile expanding on a point in your original question – converting to an OpenSSH format key.
Renci.SshNet can’t use PuTTY keys that start with:
PuTTY-User-Key-File-2: ssh-rsa
You can use puttygen.exe to convert to the OpenSSH format
- load your key file in puttygen.exe
- Conversions > Export OpenSSH key (not the “force new file format” option)
This will make a key that starts with:
-----BEGIN RSA PRIVATE KEY-----
and that will work