-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Linux server builds cannot instance nodes with mono C# scripts attached #40805
Comments
If anyone is interested, the error persists with 3.2.3RC3 Mono with the RC3 Linux server binary. But still works when exporting for Windows. |
The fix is to export the project for the X11 platform without the Debug option, i.e. in release mode (bottom of the file selection dialog shown after clicking "Export Project"). This causes the exported This is caused by two factors:
Alternatively, if you need the information you get from having debug builds, you can build the server yourself, specifying Notes I took as I was looking into this issue. Figured I might as well post them to show how I came to this solution: Running the server binary with the
Unfortunately setting Since
I tried to see which directories Mono considers using their debug logging, but unfortunately the flags didn't seem to have any effect, so I tried digging in the Mono source instead. The log we get from method includes a path which as it turns out is set by Godot here to determine that path. However, that path is not the only place Mono looks for the corlib assembly. Mono actually calls
So let's go back to the The BCL used for server and X11 should both be the same, so why don't we see them in the export directory? The project setting Is this the problem? The Bingo! |
@opl- Wow, exporting it to Linux without debugging works. Thank you very much for posting the solution here, appreciate the effective digging you have done! Great work! |
In case of anyone wondering, I can confirm that exported Godot Mono 3.2.3 projects for Linux Servers with debug tools still cannot instance nodes with C# scripts attached. Without debug tools however, it's working well. |
Confirmed in 3.4, clicking export -> debug does not work, but release does. Also, could do with more clarification on how to export a server build. Took me a while to figure out "Export all" > Release seems to be the correct way, which is different to most tutorials I found. Keep up the good work! |
Godot version:
Godot Engine v3.2.2.stable.mono.official
OS/device including version:
Building on Windows 10 64 bit with visual studio 2019 installed
Building for Linux/Debian10, with Linux Server Binary, Mono software installed.
Issue description:
When I export any project to Linux from my windows PC with the official Linux server binary downloaded from the Godot website I keep on getting the exact same error when I run the server with all my (test/reproduction) projects:
ERROR: can_instance: Method failed. Returning: __null At: modules/mono/csharp_script.cpp:2939.
My projects run perfectly fine when exporting for Windows but for Linux server builds, the projects work like halfway, for all Linux server build projects that I export and use the server binary with GDScript and other nodes without C# scripts attached are present and functional, but all nodes with C# scripts attached just aren't instanced and not present in the server on run-time.
I looked through the Godot engine code and it is this that is returning the error:
// The project assembly is not loaded ERR_FAIL_V_MSG(false, "Cannot instance script because the project assembly is not loaded. Script: '" + get_path() + "'.");
So the project assembly is not loaded apparently? How would I go about fixing this for my projects?
To be clear, no project I work with works when exporting it to Linux with the server binary. Brand new fresh projects return the same error as the real projects I work on when trying to export and run them on Linux as a server.
Related issues:
#34765 (This is for the editor with a project name change and the solutions for this also did not work for me)
#38268 (This issue does not explicitly focus on this specific error and the OP had his issue resolved but none of the mentioned fixes there works for my case)
I'm pretty new to C# setups and my package and assembly management knowledge is beginner level.
Thank you for your time.
Steps to reproduce:
Minimal reproduction project:
linuxBugProject.zip
The text was updated successfully, but these errors were encountered: