Editor Breaks when attaching debugger

I recently upgraded to 2022.3.20f1 and get the following stack trace when I play the game after attaching a debugger:

FileNotFoundException: Could not load file or assembly 'UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
System.MonoCustomAttrs.GetCustomAttributesBase (System.Reflection.ICustomAttributeProvider obj, System.Type attributeType, System.Boolean inheritedOnly) (at <dc753a1061284f8e971ee88ee4826eee>:0)
System.MonoCustomAttrs.GetCustomAttributes (System.Reflection.ICustomAttributeProvider obj, System.Type attributeType, System.Boolean inherit) (at <dc753a1061284f8e971ee88ee4826eee>:0)
System.RuntimeType.GetCustomAttributes (System.Type attributeType, System.Boolean inherit) (at <dc753a1061284f8e971ee88ee4826eee>:0)
UnityEditor.ObjectNames+InspectorTitles..cctor () (at <5d5ebefe97114215928ac1d9cd096522>:0)
Rethrow as TypeInitializationException: The type initializer for 'InspectorTitles' threw an exception.
UnityEditor.ObjectNames.GetInspectorTitle (UnityEngine.Object obj, System.Boolean multiObjectEditing) (at <5d5ebefe97114215928ac1d9cd096522>:0)
UnityEditor.ObjectNames.GetInspectorTitle (UnityEngine.Object obj) (at <5d5ebefe97114215928ac1d9cd096522>:0)
UnityEditor.UIElements.EditorElement.Init () (at <5d5ebefe97114215928ac1d9cd096522>:0)
UnityEditor.UIElements.EditorElement..ctor (System.Int32 editorIndex, UnityEditor.IPropertyView iw, System.Boolean isCulled) (at <5d5ebefe97114215928ac1d9cd096522>:0)
UnityEditor.PropertyEditor.DrawEditors (UnityEditor.Editor[] editors) (at <5d5ebefe97114215928ac1d9cd096522>:0)
UnityEditor.PropertyEditor.RebuildContentsContainers () (at <5d5ebefe97114215928ac1d9cd096522>:0)
UnityEditor.InspectorWindow.RedrawFromNative () (at <5d5ebefe97114215928ac1d9cd096522>:0)

This is using Rider’s Unity integration. Once this happens, everything else I do causes more of these errors. The inspector window stops working completely and I need to close the application in order to fix it. I’ve already reinstalled the Editor.

Does this happen with a new, empty project and the latest Rider package and Rider version?

I also use Rider and have never had this issue, and I was recently debugging in 2022.3.

It doesn’t occur when I try it on a new project. I tried regenerating all the project files in Unity preferences but it didn’t help. The interesting thing is that it seems to only happen when I attach the debugger before entering play mode.

Rider version is 2023.3.3

bump this still happens every single time

I’ve used VS2022 and prev versions for the greater part of a decade, and now with Rider, i’ve always had sketchy issues w debugging in unity. Various projects, various IDEs and unity versions. I’m convinced it’s a unity issue.

Hi, robcarlan. In case this is still happening, could you please report this bug via the Bug Reporter (“Help → Report a Bug…” in the Unity Editor)? Make sure to do that while having your problematic project open so it would be attached to the report. Cheers.