InvalidOperationException: Collection was modified; enumeration operation may not execute.

Discussion and help for Easy Save 3
Post Reply
Giezi
Posts: 8
Joined: Thu May 06, 2021 10:54 am

InvalidOperationException: Collection was modified; enumeration operation may not execute.

Post by Giezi »

Hy

I upgraded to the latest version of ES3 and since then I get the following error when I save my data (still works, and I am not sure where the error exactly comes from):

Code: Select all

InvalidOperationException: Collection was modified; enumeration operation may not execute.
System.Collections.Generic.Dictionary`2+Enumerator[TKey,TValue].MoveNext () (at <3dd5df5ef4974f29afeb2d3ba227c5da>:0)
System.Linq.Enumerable+WhereSelectEnumerableIterator`2[TSource,TResult].MoveNext () (at <6d8d8bfa07a94600b91503349e4a8e4f>:0)
ES3Internal.ES3ReferenceMgrBase.RemoveNullValues () (at Assets/Plugins/Easy Save 3/Scripts/ES3ReferenceMgrBase.cs:362)
ES3Internal.ES3ReferenceMgrBase.Awake () (at Assets/Plugins/Easy Save 3/Scripts/ES3ReferenceMgrBase.cs:141)
Sorry if this is an obvious error, not sure what I'm missing.

Thanks!
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: InvalidOperationException: Collection was modified; enumeration operation may not execute.

Post by Joel »

Hi there,

We had a similar error to this on 3.4.2, but this was resolved in 3.4.3.

If you’re on the very latest version and are still getting this error, please could you create a minimal project which replicates it and private message it to me with instructions.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Giezi
Posts: 8
Joined: Thu May 06, 2021 10:54 am

Re: InvalidOperationException: Collection was modified; enumeration operation may not execute.

Post by Giezi »

Thanks for the fast answer!

Looks like I'm on 3.5.3 which I believe is the last version on the asset store.

I will try, but the project I'm using it with is very big, it might take a while.

Thanks a lot!

Best
Giezi
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: InvalidOperationException: Collection was modified; enumeration operation may not execute.

Post by Joel »

Hi Giezi,

Just before you go to too much effort in creating a minimal project, I've created a version which uses a slightly different method for RemoveNullValues() which might resolve the issue. I'll private message this over to you now.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Post Reply