Microsoft, I'm looking at you.
I was writing a small app for work, which needs to run on an old machine running XP SP1 with .NET framework 2.0.
So I build the app for .NET 2.0 using VS 2012. All compiles fine. All runs fine on my machine, and a test VM with .NET 2.0 only.
Take it to work and it dies with a System.MissingMethodException when it comes across a call to WaitHandle.WaitOne(int)
After a number of hours of headscratching, I find the problem. MS changed the public interface to WaitHandle.WaitOne in the .NET 2.0 SP2 (which I had on my VM, but was not present on the work machine), adding several overloads to the method. More importantly, both DLLs had the exact same version number, so there was no way to tell which was which, unless you knew whether SP2 was installed or not. Further VS2012 did not provide any warnings that the method I was calling was not supported in the targeted framework (nor indeed, does the MSDN documentation).
Edited title to remove profanity. No cursing in the technical forums, please.
Markbnj
Programming mod
I was writing a small app for work, which needs to run on an old machine running XP SP1 with .NET framework 2.0.
So I build the app for .NET 2.0 using VS 2012. All compiles fine. All runs fine on my machine, and a test VM with .NET 2.0 only.
Take it to work and it dies with a System.MissingMethodException when it comes across a call to WaitHandle.WaitOne(int)
After a number of hours of headscratching, I find the problem. MS changed the public interface to WaitHandle.WaitOne in the .NET 2.0 SP2 (which I had on my VM, but was not present on the work machine), adding several overloads to the method. More importantly, both DLLs had the exact same version number, so there was no way to tell which was which, unless you knew whether SP2 was installed or not. Further VS2012 did not provide any warnings that the method I was calling was not supported in the targeted framework (nor indeed, does the MSDN documentation).
Edited title to remove profanity. No cursing in the technical forums, please.
Markbnj
Programming mod
Last edited by a moderator: