I have a small C # library with a static class that contains a very large but simple four-dimensional byte array representing a multi-dimensional decision table (about 90 KB in total).
There is another data structure, a dictionary, which helps index the decision table in the first dimension.
This decision table is a static private data element initialized by static array initializers. Code is created in Visual Studio 2010 with T4, from Excel documents.
Decisions are made through a static method, which is indexed into a multidimensional array.
When I run a simple test application using this library, it bombes "System.TypeLoadException: Internal constraint: too many fields." Exception on the first call to the static solution method.
one topic related to remoteness in Stackoverflow mentions libraries with "too many characters." Maybe I'm wrong, but there are really very few characters in my library.
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}
},
... etc...