-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Description
Describe the bug
Specifically, after I switched branches and Unity was reloading, I saw the following print out in the editor:
InvalidOperationException: Collection was modified; enumeration operation may not execute.
System.Collections.Generic.Dictionary`2+Enumerator[TKey,TValue].MoveNext () (at <df7127ba07dc446d9f5831a0ec7b1d63>:0)
Microsoft.MixedReality.Toolkit.Utilities.Editor.MixedRealityToolkitFiles.TryUnregisterModuleFolder (System.String folder) (at Assets/MixedRealityToolkit/Utilities/Editor/Setup/MixedRealityToolkitFiles.cs:220)
Microsoft.MixedReality.Toolkit.Utilities.Editor.MixedRealityToolkitFiles+AssetPostprocessor.OnPostprocessAllAssets (System.String[] importedAssets, System.String[] deletedAssets, System.String[] movedAssets, System.String[] movedFromAssetPaths) (at Assets/MixedRealityToolkit/Utilities/Editor/Setup/MixedRealityToolkitFiles.cs:91)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <df7127ba07dc446d9f5831a0ec7b1d63>:0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <df7127ba07dc446d9f5831a0ec7b1d63>:0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <df7127ba07dc446d9f5831a0ec7b1d63>:0)
UnityEditor.AssetPostprocessingInternal.PostprocessAllAssets (System.String[] importedAssets, System.String[] addedAssets, System.String[] deletedAssets, System.String[] movedAssets, System.String[] movedFromPathAssets) (at C:/buildslave/unity/build/Editor/Mono/AssetPostprocessor.cs:141)
To reproduce
I've seen this a few times, so here are what I think the most likely repro steps are:
- Switch branches while the project is open in Unity (or maybe even just edit a script so Unity reloads something) (it might be specific to a folder being created / removed)
- Re-focus the editor
- Allow it to reload assets
- See exception in console
Screenshots
Your Setup (please complete the following information)
- Unity Version [e.g. 2018.3.11f1]: 2018.4.6f1
- MRTK Version [e.g. v2.0]: mrtk_development
