I have a small C# library with a static class that holds a very large, but simple four-dimensional byte array representing a multi-dimensional decision table (about 90K bytes in total).
There's one other data structure of note in there, a Dictionary which helps index into the first dimension of the decision table.
This decision table is a static private data member, initialized by array static initializers. The code is generated in Visual Studio 2010 with T4, from Excel documents.
Decisions are obtained via a static method that indexes into the multi-dimensional array.
When I run a simple test app using this library, it bombs with a "System.TypeLoadException: Internal limitation: too many fields." Exception, at the first invocation of the static decision method.
The one remotely related topic on Stackoverflow mentions libraries with "too many symbols". I may be wrong but my library seems to have very few symbols indeed.
What's going on here?
Code Snippet:
private static byte[][][][] decisions = new byte[][][][] {
new byte[][][] {
new byte[][] {
new byte[]{5,6,6},new byte[]{5,6,6},
new byte[]{5,6,6},new byte[]{5,6,6},new byte[]{5,6,6},
new byte[]{5,6,6},new byte[]{5,6,6},new byte[]{5,6,6},new byte[]{5,6,6},
new byte[]{5,6,6},new byte[]{5,6,6},new byte[]{5,6,6},new byte[]{5,6,6},new byte[]{5,6,6},
new byte[]{5,6,6},new byte[]{5,6,6},new byte[]{5,6,6},new byte[]{5,6,6},new byte[]{5,6,6},new byte[]{5,6,6},
new byte[]{5,6,6},new byte[]{5,6,6},new byte[]{5,6,6},new byte[]{5,6,6},new byte[]{5,6,6},new byte[]{5,6,6},new byte[]{5,6,6},
new byte[]{5,6,6},new byte[]{5,6,6},new byte[]{5,6,6},new byte[]{5,6,6},new byte[]{5,6,6},new byte[]{5,6,6},new byte[]{5,6,6},new byte[]{5,6,6},
new byte[]{5,6,6},new byte[]{5,6,6},new byte[]{5,6,6},new byte[]{5,6,6},new byte[]{5,6,6},new byte[]{5,6,6},new byte[]{5,6,6},new byte[]{5,6,6},new byte[]{5,6,6}
},
new byte[][] {
new byte[]{5,6,6},new byte[]{5,6,6},
new byte[]{5,6,6},new byte[]{5,6,6},new byte[]{5,6,6},
new byte[]{5,6,6},new byte[]{5,6,6},new byte[]{5,6,6},new byte[]{5,6,6},
new byte[]{5,6,6},new byte[]{5,6,6},new byte[]{5,6,6},new byte[]{5,6,6},new byte[]{5,6,6},
new byte[]{5,6,6},new byte[]{5,6,6},new byte[]{5,6,6},new byte[]{5,6,6},new byte[]{5,6,6},new byte[]{5,6,6},
new byte[]{5,6,6},new byte[]{5,6,6},new byte[]{5,6,6},new byte[]{5,6,6},new byte[]{5,6,6},new byte[]{5,6,6},new byte[]{5,6,6},
new byte[]{5,6,6},new byte[]{5,6,6},new byte[]{5,6,6},new byte[]{5,6,6},new byte[]{5,6,6},new byte[]{5,6,6},new byte[]{5,6,6},new byte[]{5,6,6},
new byte[]{5,6,6},new byte[]{5,6,6},new byte[]{5,6,6},new byte[]{5,6,6},new byte[]{5,6,6},new byte[]{5,6,6},new byte[]{5,6,6},new byte[]{5,6,6},new byte[]{5,6,6}
},
...and so on...