I just ran into this damn message again but after changing the compiler output to show more information I found this in the list.
Exceeded maximum number (255) of static methods: 255
This is certainly more helpful and I can try and break up the code to alleviate this issue.
Hopefully this will help others who have ran into this error.
Under tools and options, locate Projects and Solutions and then the Build and Run section. Change the MSBuild project build output verbosity to detailed. Donât use DIAGNOSTIC as it generates a hell of a lot of stuff that means little. Now when you get this error you will see something like this (this is from my build)
3> Exceeded maximum number (255) of static methods: 255
3> Failed compiling type 'MNTEnergy7.Program'
3>MMP : error MMP0000: CLR_E_OUT_OF_RANGE
I simply removed 1 static function and rebuilt it and it compiled.
My main app is always static as I use pure NETMF but I wonder if I could get around this by creating a wrapper similar to what Gadgeteer does and make main a class I instantiate instead?