I would like to use something like this:
Dictionary<int, string>[] matrix = new Dictionary<int, string>[2];
But, when I do:
matrix[0].Add(0, "first str");
It throws " 'TargetInvocationException '...Exception has been thrown by the target of an invocation."
What is the problem? Am I using that array of dictionaries correctly?
NullReferenceException. Show more code.matrix[0]to a newDictionary<int, string>? Also,TargetInvocationExceptionis part of theSystem.Reflectionnamespace. Where are you using reflection?