After deploying an ASP.net webservice to my production server i got this exception:
System.MissingMethodException
Method not found: 'Boolean
System.Threading.WaitHandle.WaitOne(Int32)'
The MSDN documentation states:
Version Information
.NET Framework
Supported in: 3.5 SP1, 3.0 SP2, 2.0 SP2
so the reason of this error is that my server was not updated to the latest service pack.
The question is:
Why does the code start? IMO if the target framework version is different the app should not start at all.
How can I assure that my code can run on the target machine framework version before JIT?
This is crazy. I think Microsoft should take versioning issues more seriously.
Best Answer
Though the method:
doesn't exist, the method:
does exist.
Looking with the reflector - the
WaitOne(Int32)
callsWaitOne(Int32,bool)
withfalse
as the boolean value. So simply use the second signature, providingfalse
as the boolean value, and you should be just fine.