After Deserializing a file with just one record
It seems that it’s in an infinitive loop
IndexSeries = (List<string>)bFormatter.Deserialize(fsSeriesIndexGet);
IndexSeries.ForEach(name => AddSerie(name));
//IndexSeries.ForEach(delegate(String name)
//{
// AddSerie(name);
//});
AddSerie will be executed infinitively !
If I define:
Then
executes normally, outputing a single string, while
loops indefinitely, adding ‘!’s in the process, and
throws an InvalidOperationException (Collection was modified; enumeration operation may not execute), which, in my opinion is the correct behavior. Why the
List.ForEachmethod allows the list to be changed by the action, I do not know, but would like to find out 🙂