Some unity projects may use dynamic generated assemblies. In this case when enter playing mode, a NotSupportedException will be thrown from the static constructor of DebugLogConsole with these logs:
NotSupportedException: The invoked member is not supported in a dynamic module.
System.Reflection.Emit.AssemblyBuilder.GetExportedTypes () (at <9577ac7a62ef43179789031239ba8798>:0)
IngameDebugConsole.DebugLogConsole..cctor () (at Library/PackageCache/com.yasirkula.ingamedebugconsole@1.4.1/Plugins/IngameDebugConsole/Scripts/DebugLogConsole.cs:160)
Rethrow as TypeInitializationException: The type initializer for 'IngameDebugConsole.DebugLogConsole' threw an exception.
IngameDebugConsole.DebugLogManager.OnDisable () (at Library/PackageCache/com.yasirkula.ingamedebugconsole@1.4.1/Plugins/IngameDebugConsole/Scripts/DebugLogManager.cs:425)
Reproduction steps
URP and HDRP are using dynamic generated assemblies in editor. Projects with these pipelines may run into this issue. Here's a simple reproduction:
Create a new Unity project with template Universal Render Pipeline.
Install In-game debug console and drag the prefab to the scene.
Enter play mode.
Platform specs
Please provide the following info if this is a Unity 3D repository.
Plugin version: 1.4.1
Unity version: 2020.2.0f1, with URP
Platform: Windows
How did you download the plugin: UPM
Additional info
Maybe just check Assembly.IsDynamic and bypass dynamic assemblies in the static constructor of DebugLogConsole.
Description of the bug
Some unity projects may use dynamic generated assemblies. In this case when enter playing mode, a
NotSupportedException
will be thrown from the static constructor ofDebugLogConsole
with these logs:Reproduction steps
URP and HDRP are using dynamic generated assemblies in editor. Projects with these pipelines may run into this issue. Here's a simple reproduction:
Platform specs
Please provide the following info if this is a Unity 3D repository.
Additional info
Maybe just check
Assembly.IsDynamic
and bypass dynamic assemblies in the static constructor ofDebugLogConsole
.