System.MissingMethodException during connect

Nov 9, 2011 at 4:30 PM
Edited Nov 9, 2011 at 4:32 PM

During the SshClient.Connect() command the following error is received on runtime:

System.MissingMethodException: Method not found: 'Boolean System.Threading.WaitHandle.WaitOne(System.TimeSpan)'.
   at Renci.SshNet.Session.SocketConnect()
   at Renci.SshNet.Session.Connect()
   at Renci.SshNet.BaseClient.Connect()

This happens with the newest download and 11931 change set. Also does not happen on every computer system.

I should also mention I am using the net3.5 library.

Nov 9, 2011 at 6:21 PM

Further analysis it looks like the problem is System.Threading.WaitHandle.WaitOne(System.TimeSpan) does not exist in net3.5. this commands looks like it was introduced on 3.5 SP1. This will fail on any system that does not have 3.5 SP1 installed. There should be an equivalent function though that does exist.

Coordinator
Nov 10, 2011 at 1:35 PM

I saw you opened an issue for this, thanks,

 

I will get to it as soon as I am done with current project I am working on, which should be done closer to the end of this month.

 

Thanks,

Oleg

Nov 10, 2011 at 2:33 PM

Yep no problem. 

From some research i did it looks like you may be able to fix this by substituting with a different overload varient of the System.Threading.WaitHandle.WaitOne command. It seems that the command exists in 3.5 but just not the overload version with System.TimeSpan. I believe though there is a overload taking System.TimeSpan and Boolean parameters.

Hopefully this helps.