-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Hello
I ve got this exception "collection was modified; enumeration operation may not execute" during service initialisation.
It is thrown in Oddr.Builders.Devices.TwoStepDeviceBuilder.AfterOrderingCompleteInit after the first call of SortElement(step1Token);
foreach (String step1Token in orderedRules.Keys)
{
SortElement(step1Token);
}
This exception was thrown because SortElement modifies orderedRules.Keys collection.
To solve the issue, I changed the code by :
String[] stringKeys = new String[orderedRules.Keys.Count];
orderedRules.Keys.CopyTo(stringKeys, 0);
foreach (String step1Token in stringKeys)
{
SortElement(step1Token);
}
Metadata
Metadata
Assignees
Labels
No labels