Possible Duplicate:
Collection was modified; enumeration operation may not execute
I have a generic List where I execute some actions while enumerating.
foreach(Action<string> action in actionList)
{
if(action != null) {
action(mystring);
}
}
Now I get this exception:
InvalidOperationException:
Collection was modified; enumeration operation may not execute
How can this be solved, I am nailed tight to .NET 3.5 :/