<dpriver@gmail.com> wrote:[color=blue]
> I have to initialize a huge constant array of structures(60000~100000),
> used as a lookup table , but it failed with
> System.InvalidProgramException
> when the items reach 18400. and if I change the item type from struct
> to class,
> the threshold is 35000 . It seems that there a size limition when
> initialize constant in CLR.
> Is there any configurable parameters can be used to increase this
> limition in C# compiler
> or .NET framework. Or I'm missing something there?[/color]
This really isn't the best way of accomplishing your task. It would be
much better to load the data from a stream (whether an embedded
resource or an external file). That way you won't run into this limit,
and your code will be a lot simpler too!
--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog:
http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too