InvalidProgramException

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have a major roadblock , where while debugging/running I get and InvalidProgramException (detected by the CLR) .
This occurs when the program flow goes into a very large method with maybe 1000 case statements . (Code that was autogenerated based on some other constraints) . {All code is in C# using .NET Framework 1.1 }

I researched this exception in mSDN and was pointed to see article Q312544, "What to Do If You Receive an InvalidProgramException Error Message"
I cannot find this article !

Breaking this method up into smaller methods is not my first choice so if anyone knows any other way to make this work please respond .

Thanks
Ryan
 
I have a major roadblock , where while debugging/running I get and
InvalidProgramException (detected by the CLR) .
This occurs when the program flow goes into a very large method with
maybe 1000 case statements . (Code that was autogenerated based on some
other constraints) . {All code is in C# using .NET Framework 1.1 }
I researched this exception in mSDN and was pointed to see article
Q312544, "What to Do If You Receive an InvalidProgramException Error
Message"
I cannot find this article !

Breaking this method up into smaller methods is not my first choice so if
anyone knows any other way to make this work please respond .

If your method exceed the maximum size of a method you have no choice, you
have to break your method in several smaller methods. You also can use
if-statements instead of case-statements since if produces far less code.

Why do you need such a large case statement? Does this logic really have to
be precompiled?Performance reasons?

Could you please show (at least a part) of your method *please*.

Iam so nosey :)
 
Back
Top