Problem when exporting a c# project
-
Hello. I ran into a problem when exporting a game that uses c#.
As you can see, the .net console window opens, but at the same time, no matter how long I wait, nothing happens.
What could this be related to and how can I fix it? -
It'd be worth checking that the dotnet SDK is correct. In your windows cmd/pwsh:
dotnet --info
6.0+ is required for 4.1.1.
If there isn't an obvious issue with the SDK another thing worth checking would be that the .csproj
and .sln resources are present at the root of the project.After that I'm not truly sure what the correct next step to be, though I know what I would do. I would backup/clone my project safely elsewhere and then I would delete the .godot/mono folder in the project working directory with the editor closed and none of the resources opened in other applications. This folder will be regenerated when you open and run the project next.
This last thing is actually recommended in the docs, and has fixed a few .net/mono things for me in the past when things get... stuck?
"https://docs.godotengine.org/en/stable/tutorials/scripting/c_sharp/c_sharp_basics.html"
-
@TC93DEV, thanks for the answer, but unfortunately it didn't help me. I have an up-to-date version of .net, I also tried a method with deleting a folder, but it did not give results.
-
Sorry it didn't help mate.
Just found an interesting and possibly related bug that has been raised for 4.1.1 and a cursory look might imply some connection between .net/godot localisation and building.
Unable to Build Project with c# solution (Godot 4.1.1) · Issue #81790 · godotengine/godot
Godot version 4.1.1 Stable System information Windows 10 - Gotot 4.1.1 Stable Issue description Run Game failed if i have c# solution in project with these errors editor/editor_node.cpp:6468 - An EditorPlugin build callback failed. Trans...
GitHub (github.com)
Some env vars might not be getting set properly when launching Godot from the exe, but if they call it from a terminal it has the right sauce. Couple more things based off reading that issue:
Launch the godot editor from command line. Open up a terminal, cd to the godot directory, run it from shell. This might well fix the problem entirely.
If that doesn't work, check the dotnet -> build area of the Godot editor. Make sure console output is on and try increasing the verbosity to get some output.
If that doesn't work, you might be able to get an actual useable error report by, again in the windows cmd/pwsh, go to the project directory and run:
dotnet build
This isn't expected to succeed but might give us some sensible output.
If those things fail I'm afraid I might be out of ideas. It would be worth adding any details you can provide to the issue I linked, or (hopefully) details of any solution/fix you find!
-
@TC93DEV Forgive me, I am very bad at English and the translator does not work very well with such texts. So I tried to do as much as I understood you. To begin with, I build a solution through the console, this can be seen on the first several lines. Next, I launched godot through the console, after that, the errors below immediately appeared (up to the last line), after that I tried to export the project, and when starting from the console .net window does not open.
Then I switched logging to the most detailed and got the following result in MSBuild:Running: "C:\Program Files\dotnet\dotnet.EXE" publish D:/Godot/Proxima-B2/Proxima-B.csproj -c ExportDebug -r win-x64 --self-contained true -v diagnostic -noconlog -l:GodotTools.BuildLogger.GodotBuildLogger,D:/programs/Godot_v4.1.1-stable_mono_win64/GodotSharp/Tools\GodotTools.BuildLogger.dll;C:/Users/Семён/AppData/Roaming/Godot/mono/build_logs\aef7e74f485dde31486cceb63376289c_ExportDebug -p:GodotTargetPlatform=windows -o C:\Users\Семён\AppData\Local\Temp\godot-publish-dotnet\12264-ExportDebug-win-x64 MSBuild version 17.6.1+8ffc3fe3d for .NET C:\Program Files\dotnet\sdk\7.0.302\MSBuild.dll -noconlog --property:_IsPublishing=true --property:GodotTargetPlatform=windows -property:PublishDir=C:\Users\Семён\AppData\Local\Temp\godot-publish-dotnet\12264-ExportDebug-win-x64 -property:_CommandLineDefinedOutputPath=true -property:SelfContained=True -property:_CommandLineDefinedSelfContained=true -property:RuntimeIdentifier=win-x64 -property:_CommandLineDefinedRuntimeIdentifier=true -property:Configuration=ExportDebug -distributedlogger:Microsoft.DotNet.Tools.MSBuild.MSBuildLogger,C:\Program Files\dotnet\sdk\7.0.302\dotnet.dll*Microsoft.DotNet.Tools.MSBuild.MSBuildForwardingLogger,C:\Program Files\dotnet\sdk\7.0.302\dotnet.dll -l:GodotTools.BuildLogger.GodotBuildLogger,D:/programs/Godot_v4.1.1-stable_mono_win64/GodotSharp/Tools\GodotTools.BuildLogger.dll;C:/Users/Семён/AppData/Roaming/Godot/mono/build_logs\aef7e74f485dde31486cceb63376289c_ExportDebug -maxcpucount -restore -target:Publish -verbosity:m -verbosity:diagnostic D:/Godot/Proxima-B2/Proxima-B.csproj
And in the output it is:
Transient parent has another exclusive child. modules/mono/glue/runtime_interop.cpp:1324 - Failed to export project: Failed to build project. Could not create child process: rcedit D:/Godot/Proxima-B2/Build/Proxima-B.exe --set-icon C:/Users/Семён/AppData/Local/Godot/_rcedit.ico --set-version-string CompanyName beta-for-leath0r --set-version-string ProductName beta-for-leath0r --set-version-string FileDescription beta-for-leath0r --set-version-string LegalCopyright beta-for-leath0r --set-version-string LegalTrademarks beta-for-leath0r editor/export/editor_export_platform.h:175 - Изменение ресурсов: Не удалось запустить исполняемый файл rcedit. Настройте путь rcedit в настройках редактора (Экспорт > Windows > rcedit) или отключите "Приложение > Изменить ресурсы" в пресете экспорта. Could not create child process: rcedit D:/Godot/Proxima-B2/Build/Proxima-B.console.exe --set-icon C:/Users/Семён/AppData/Local/Godot/_rcedit.ico --set-version-string CompanyName beta-for-leath0r --set-version-string ProductName beta-for-leath0r --set-version-string FileDescription beta-for-leath0r --set-version-string LegalCopyright beta-for-leath0r --set-version-string LegalTrademarks beta-for-leath0r editor/export/editor_export_platform.h:175 - Изменение ресурсов: Не удалось запустить исполняемый файл rcedit. Настройте путь rcedit в настройках редактора (Экспорт > Windows > rcedit) или отключите "Приложение > Изменить ресурсы" в пресете экспорта.
But I can't say if these errors occurred only after I closed .net console or not.
And I also have one hypothesis. I noticed that godot does not work correctly with Russian characters in scripts, even if they are comments to the code. Perhaps the problem is in the Russian characters that are contained in the path.I really hope that I was able to provide you with the right information, thank you so much for helping me.
-
@Семён-Дружинин said in Problem when exporting a c# project:
Forgive me, I am very bad at English and the translator does not work very well with such texts.
It's all good. I will try to be more concise instead of rambling!
Hopefully we have found the issue, or at least we have found two issues.
This issue is related to rcedit.
modules/mono/glue/runtime_interop.cpp:1324 - Failed to export project: Failed to build project. Could not create child process: rcedit D:/Godot/Proxima-B2/Build/Proxima-B.exe --set-icon C:/Users/Семён/AppData/Local/Godot/_rcedit.ico --set-version-string CompanyName beta-for-leath0r --set-version-string ProductName beta-for-leath0r --set-version-string FileDescription beta-for-leath0r --set-version-string LegalCopyright beta-for-leath0r --set-version-string LegalTrademarks beta-for-leath0r editor/export/editor_export_platform.h:175 - Изменение ресурсов: Не удалось запустить исполняемый файл rcedit. Настройте путь rcedit в настройках редактора (Экспорт > Windows > rcedit) или отключите "Приложение > Изменить ресурсы" в пресете экспорта. Could not create child process: rcedit D:/Godot/Proxima-B2/Build/Proxima-B.console.exe --set-icon C:/Users/Семён/AppData/Local/Godot/_rcedit.ico --set-version-string CompanyName beta-for-leath0r --set-version-string ProductName beta-for-leath0r --set-version-string FileDescription beta-for-leath0r --set-version-string LegalCopyright beta-for-leath0r --set-version-string LegalTrademarks beta-for-leath0r editor/export/editor_export_platform.h:175 - Изменение ресурсов: Не удалось запустить исполняемый файл rcedit. Настройте путь rcedit в настройках редактора (Экспорт > Windows > rcedit) или отключите "Приложение > Изменить ресурсы" в пресете экспорта.
Godot is missing rcedit. To set custom icons among other things in the build process you need rcedit installed.
docs.godotengine.org/en/stable/tutorials/export/changing_application_icon_for_windows.html
github.com/electron/rcedit/releases
Point to the rcedit.exe at Editor Settings -> General -> Export -> Windows -> rcedit.
The second, different issue:
There is a resource in the project using a Cubemap Array which is not supported in Compatibility mode; this will need to be removed or you'll need to use Forward+ rendering.
Internal rendering architecture
This page is a high-level overview of Godot 4's internal renderer design. It does not apply to previous Godot versions. The goal of this page is to document design decisions taken to best suit Godo...
Godot Engine documentation (docs.godotengine.org)
Starting with these two things will get you on the right track mate. Rcedit is the easier of the two to fix so perhaps start with that.
Good luck, let me know how you go!