Skip to content


Subversion checkout URL

You can clone with
Download ZIP


"Collection was modified exception" in InProcessMessageBus.WaitForMessages #537

samueldjack opened this Issue · 2 comments

3 participants


I'm seeing a sporadic "Collection was modified" exception when enumerating the eventKeys enumerable in InProcessMessageBus.WaitForMessages.

The simple fix is to do

var eventKeysList = eventKeys.ToList();

at the top of the method, then use eventKeysList in place of eventKeys.


I also get this error a lot, and the fix mentioned above works.

This is also related: #388


Note that I was also having other issues, with my clients not receiving some messages issued by the server (it was very random).

After applying this fix, all messages now arrive properly at clients.

@davidfowl davidfowl was assigned
@davidfowl davidfowl closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.