I get this error message depending on the parameters that I enter for my constants.
"An unhandled exception of type 'System.TypeInitializationException' occurred in TEST_C_26_6_2_COPY.exe"
"Additional information: The type initializer for 'aGV' threw an exception."
The funny thing is that I only get this error message when I enter certain values for my V, K, T, BLOCKS, REPLACEMENT_MAXBLOCK, REPLACEMENT_ACTIVEBLOCKS;
For example when I enter V = 10, K = 5, T = 3, BLOCKS = 17, REPLACEMENT_MAXBLOCK = 17, REPLACEMENT_ACTIVEBLOCKS = 17
there are no problems.
Conversely, when I enter V = 9, K = 4, T = 3, BLOCKS = 25, REPLACEMENT_MAXBLOCK = 25, REPLACEMENT_ACTIVEBLOCKS = 25
I get the error message pointing to the code in my Main() for the aGV.Cov
Expand|Select|Wrap|Line Numbers
- for (liMiscLp = 0; liMiscLp <= aGV.BLOCKS; liMiscLp++)
- {
- aGV.Cov[liMiscLp, liKLp] = liKLp;
- }
These are my constants that I declare in my aGV global variables method:
Expand|Select|Wrap|Line Numbers
- class aGV
- {
- public const int V = 9; // This is v
- public const int K = 4; // This is k
- public const int T = 3; // This is t
- public const int BLOCKS = 25;
- public const int REPLACEMENT_MAXBLOCK = 25;
- public const int REPLACEMENT_ACTIVEBLOCKS = 25;
- public static int[,] Cov = new int[aGV.BLOCKS + 1, aGV.NOCOLUMNS];
- public static int[,] PCov = new int[aGV.BLOCKS + 1, aGV.NOCOLUMNS];
- public static int[,] OCov = new int[aGV.BLOCKS + 1, aGV.NOCOLUMNS];
- }
Any ideas why this happens only when certain parameters are entered?
TIA
Roy