Yesterday, I came accross a bizarre error. When executing my Smart device application on the Windows CE emulator, I got a “NotSupportedException”. What was even stranger, was that I got this in the InitializeComponents method, which is generated by Visual Studio.
After quite a bit of searching and debugging, the problem didn’t seem to be the code, but the amount of code. For some reason, when the InitializeComponents method contains more than 937 lines of code, it crashes in the emulator. It doesn’t matter what lines are left out or put in, as long as it is less than that strange number of 937 lines :S