I have an instance of Dictionary<string, mystruct> for which I am compiling a list of all the values:
var list = m_Records.Values.ToList();
Sometimes I get the following error:
ArgumentException Destination array is not long enough to copy all the items in the collection. Check array index and length.
I am trying to understand how this is possible even from one very simple line. When VS2010 breaks down on this error, I can check m_Records and see that it has, say, 24 records (varies slightly). But it does matter, and m_Records, of course, is not null.
source share