Is there a way to get the value of the given key in the following exception in C# in a way that affects all generic classes? I think this is a big miss in the exception description from Microsoft.
"The given key was not present in the dictionary."
A better way would be:
"The given key '" + key.ToString() + "' was not present in the dictionary."
Solutions might involve mixins or derived classes maybe.
See Question&Answers more detail:os