Update collection based on timer throws 'Collection was modified; enumeration operation may not execute.'
问题 I'm using Reactive Extensions and ReactiveUI to update a collection of Process objects periodically. When a checkbox is checked the property Processes, which is bound to a DataGrid, is filled and a timer is set to update every 200ms all processes. Processes that have exited are removed. The Collection was modified; enumeration operation may not execute. exception is sometimes thrown when doing a foreach. I don't understand, because I am not removing or adding objects to the collection when