As the text says, this could be due to a compiler bug. I believe that this exception also occurs when unverifiable code is encountered. This can also happen when you use certain features such as unsafe code (C#). Since the designer still works, this is most likely not a problem occuring in designer generated code. Unfortunately, with an error message so vague good help is hard to provide.MSDN said:InvalidProgramException
The exception that is thrown when a program contains invalid Microsoft intermediate language (MSIL) or metadata. Generally this indicates a bug in the compiler that generated the program.