Wednesday, 21 September 2016

Exception: The collection was modified. Enumeration operation may not execute.


Change

foreach(Object x in ObjectCollection) {...}

to

foreach(Object x in ObjectCollection.ToList()) {...}

No comments:

Post a Comment