ERROR: System.TypeInitializationException: The type initializer for 'Godot.Viewport' threw an exception.
---> Godot.GodotObject+NativeMethodBindNotFoundException: Unable to find the native method bind. (Method 'Viewport.set_world_3d')
at Godot.GodotObject.ClassDB_get_method_with_compatibility(StringName type, StringName method, UInt64 hash)
at Godot.Viewport..cctor()
--- End of inner exception stack trace ---
at Godot.Viewport.IsUsingOwnWorld3D()
at Godot.Viewport.get_OwnWorld3D()
at Rotate._Ready()
at Godot.Node.InvokeGodotClassMethod(godot_string_name& method, NativeVariantPtrArgs args, godot_variant& ret)
at Godot.CanvasItem.InvokeGodotClassMethod(godot_string_name& method, NativeVariantPtrArgs args, godot_variant& ret)
at Godot.Node2D.InvokeGodotClassMethod(godot_string_name& method, NativeVariantPtrArgs args, godot_variant& ret)
at Rotate.InvokeGodotClassMethod(godot_string_name& method, NativeVariantPtrArgs args, godot_variant& ret)
at Godot.Bridge.CSharpInstanceBridge.Call(IntPtr godotObjectGCHandle, godot_string_name* method, godot_variant** args, Int32 argCount, godot_variant_call_error* refCallError, godot_variant* ret)
at: void Godot.NativeInterop.ExceptionUtils.LogException(System.Exception) (:0)
Tested versions
Current master [01545c9]
System information
Godot v4.4.rc.mono (01545c9) - Windows 10 (build 19044) - Multi-window, 4 monitors - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 4060 Ti (NVIDIA; 32.0.15.7242) - AMD Ryzen 9 5900X 12-Core Processor (24 threads)
Issue description
As
disable_3dwon't work with editor builds, developers, must use an editor with 3d enabled (for generating C# bindings and development), leading to usability problems forGDScriptandC#.For
GDScript, scripts that directly reference 3D nodes or nodes' 3D related properties will cause runtime Parse Error:Details
For
C#, scripts that directly instantiates or loads the 3D related binding types will cause TypeInitializationException:Details
Steps to reproduce
scons p=windows module_mono_enabled=yes compiledb=yes debug_symbols=yes.\bin\godot.windows.editor.x86_64.mono.console.exe --headless --generate-mono-glue modules\mono\gluepython .\modules\mono\build_scripts\build_assemblies.py --godot-output-dir=.\binscons p=windows module_mono_enabled=yes debug_symbols=yes target=template_release arch=x86_64 disable_3d=yesa. For GDScript, create a project with GDScript that directly references 3D types (Node3D, etc.).
b. For C#, create a project with C# script that directly or indirectly references 3D types (Node3D, Viewport, etc.).
c. Alternatively, open the MRP Project.
Minimal reproduction project (MRP)
Test2dProject.zip