I have a Dictionary whose elements I need to iterate through and make changes. I cannot use foreach statement, since it sometimes throws InvalidOperationException, saying that the collection cannot be modified during an enumaration.
I can use a for loop, in conjunction with Dictionary.ElementAt method, and I successfully used it in other classes, but in this particular class, the method ElementAt cannot be found! Any ideas?