-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't build Mono projects in 3.4 beta 1: "The type initializer for 'Sys' threw an exception" #50486
Comments
Which build tool do you have configured in Editor Settings > Mono > Builds > Build Tool? |
This happens if editor fail to load one main Mono libraries ( |
oh how do I fix that? |
Indeed I might need to go back to using Wine for the build if it's the reason why it failed to build those libs (and didn't tell me :|). godotengine/build-containers@428340a |
@neikeq I do have the relevant libs in my build container, but with
|
Log (using wine):
This file is missing, but it was not present in 3.3.2 either. |
Hm indeed the libs are compiled statically so they're not present in 3.3.2 either. Here's the full diff between the files in 3.3.2-stable and 3.4-beta1's
|
Exported 3.4-beta1 Mono project (exported from macOS native editor) seems to be working fine, there are no extra dll's in it.
|
I can confirm the bug on Windows too with 3.4 beta 1 builds. I made a test build from the latest This build seems to work fine, so that confirms that the issue comes from the updated containers and not changes in the Potential problems:
Seems it refers to missing System.Native dependency which is not supposed to be included on Windows IINM, it's very likely the same cross-compilation issue which had led us to use Wine as a workaround. So it seems like I'll have to go back to the old version and figure out how to work around Wine not working properly anymore. |
So yeah, basically with godotengine/build-containers#84 I removed the workaround from godotengine/build-containers#32 as a combination of:
But the Mono buildsystem is still broken for cross-platform builds from Unix to Windows so the workaround needs to be added back. |
As discussed on rocket.chat, the BCL seems to be being built against the unix profile instead of the win32 profile. I'll check the build-container changes tomorrow to see why that's happening. |
After spending a lot of time trying to go back to the previous buildsystem with a Wine workaround for cross-compilation bugs, I found the bug :) godotengine/godot-mono-builds#46 So I'm finally building 3.4 beta 2 which should have working Mono builds for Windows. |
Godot version
v3.4.beta1.mono.official
System information
Windows 10
Issue description
I'm using MSBuild, installed from Visual Studio Build Tools 2017 15.9.36
In editor, this error is thrown whenever I try to run a scene:
modules/mono/mono_gd/gd_mono_utils.cpp:369 - System.TypeInitializationException: The type initializer for 'Sys' threw an exception.
editor/editor_node.cpp:5369 - An EditorPlugin build callback failed.
command line shows this:
Unhandled Exception:
System.TypeInitializationException: The type initializer for 'Sys' threw an exception. ---> System.DllNotFoundException: System.Native assembly: type: member:(null)
at (wrapper managed-to-native) Interop+Sys.LChflagsCanSetHiddenFlag()
at Interop+Sys..cctor () [0x00000] in <2606d1e3191f45969af1cc6149da86d0>:0
--- End of inner exception stack trace ---
at System.IO.FileSystem.FileExists (System.ReadOnlySpan
1[T] fullPath, System.Int32 fileType, Interop+ErrorInfo& errorInfo) [0x00007] in <2606d1e3191f45969af1cc6149da86d0>:0 at System.IO.FileSystem.FileExists (System.ReadOnlySpan
1[T] fullPath) [0x00006] in <2606d1e3191f45969af1cc6149da86d0>:0at System.IO.File.Exists (System.String path) [0x00043] in <2606d1e3191f45969af1cc6149da86d0>:0
at GodotTools.Utils.File.Exists (System.String path) [0x00006] in <0e2b1c349f7744a5a9e5c0be7d677bc5>:0
at GodotTools.Build.BuildManager.EditorBuildCallback () [0x00005] in <0e2b1c349f7744a5a9e5c0be7d677bc5>:0
at GodotTools.GodotSharpEditor.Build () [0x00000] in <0e2b1c349f7744a5a9e5c0be7d677bc5>:0
ERROR: System.TypeInitializationException: The type initializer for 'Sys' threw an exception.
at: debug_send_unhandled_exception_error (modules/mono/mono_gd/gd_mono_utils.cpp:369)
ERROR: An EditorPlugin build callback failed.
at: call_build (editor/editor_node.cpp:5369)
Steps to reproduce
run any scene
Minimal reproduction project
No response
The text was updated successfully, but these errors were encountered: