Given the following stack trace:
MESSAGE: Value cannot be null.Parameter name: key
SOURCE: mscorlib
TARGETSITE:
Not sure about the null but why aren't you using:
internal static KeyValuePair[] Convert(IDictionary from)
{
return from.ToArray();
}
Edit: As far as the null values are concerned. Do you have multiple threads accessing this IDictionary? Corruption is possible if you're not being thread safe. See this post for an example of corruption in the
Queue
class. How can I modify a queue collection in a loop?