tags:

views:

1489

answers:

2

Hello,

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.

+1  A: 

The same happended to me with 1.1 and 1.1 SP1 a long time ago... I guess there's not a good solution since the assemblies have the same version, you can try to validate it by hand reading the .net installed version or just install the last service packs in all your dev and production machines.

Diego Jancic
Thanks for your feedback. What a pity anyway!
Luca Martinetti
+3  A: 

I agree. The problem is that the assembly version numbers did not change.

When transitioning to .NET 3.5 SP1 I made sure that developers were not using SP1-specific APIs by ensuring the build server did not have the SP installed (ie. the build server framework version matched the target machine framework version). Then, once we were ready, SP1 was installed on the build server. A similar approach could have saved you from the pain.

HTH, Kent

Kent Boogaart