godotengine / godotengine/godot

Godot Mono editor can hang on exit when project has [dotnet] metadata but no generated .csproj

Open
#119,802 1 comment 0 reactions 0 assignees View on GitHub
bug topic:dotnet topic:editor
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

Reproducible in Godot v4.6.3.stable.mono.official [7d41c59c4].

I have not tested earlier Godot versions yet.

### System information

macOS 26.5, arm64 Godot v4.6.3.stable.mono.official [7d41c59c4] Renderer: Forward Plus / Metal .NET SDKs installed: - 10.0.102 - 10.0.300 Hardware: - Apple Silicon MacBook Pro, arm64

### Issue description

Godot Mono editor can hang on exit when a project has .NET metadata in project.godot but no generated C# project files yet.

The project appears empty from the user perspective, but project.godot contains:

[dotnet]

project/assembly_name="MMD"

At this point the project has no .csproj, no .sln, and no .cs files. When opening this project with Godot Mono, the editor initializes the .NET tooling path and attempts to load the project assembly even though the C# project files have not been generated yet.

Launching the editor from the command line shows:

.NET: Initializing module...
Found hostfxr: /usr/local/share/dotnet/host/fxr/10.0.8/libhostfxr.dylib
.NET: hostfxr initialized
.NET: GodotPlugins initialized
.NET: Failed to load project assembly

The editor also initializes the IDE messaging server:

at GodotTools.Ides.MessagingServer..ctor(String editorExecutablePath, String projectMetadataDir, ILogger logger)
at GodotTools.Ides.GodotIdeManager.GetRunningOrNewServer()
at GodotTools.Ides.GodotIdeManager._Ready()

Actual behavior:
Closing the editor window can leave the Godot Mono editor hanging/running, requiring Force Quit on macOS.

Expected behavior:
If a project has [dotnet] metadata but no .csproj yet, Godot Mono should either generate/synchronize the C# project files automatically, show a clear warning/action to generate them, or skip project assembly loading / IDE messaging initialization until a C# project exists. In all cases, the editor should still exit normally.

Workaround:
Creating a C# script generates the .csproj / .sln files. After that, the same project exits normally.

### Steps to reproduce

1. Create or open a Godot Mono project where project.godot contains:

[dotnet]

project/assembly_name="MMD"

2. Make sure the project does not contain any generated C# project files:
- no .csproj
- no .sln
- no .cs files

3. Open the project with Godot Mono.

4. Close the editor window.

Observed result:
The editor can remain running/hung and needs to be force quit on macOS.

5. Reopen the project and create a C# script so Godot generates the .csproj / .sln files.

6. Close the editor again.

Observed result after workaround:
The editor exits normally.

### Minimal reproduction project (MRP)

[godot-mono-missing-csproj-mrp.zip](https://github.com/user-attachments/files/28293812/godot-mono-missing-csproj-mrp.zip)
The MRP intentionally contains project.godot with [dotnet] metadata, but does not include .csproj, .sln, .cs files, or the .godot folder.

Contributor guide

Open the contributing guide

Research direction

Start with the minimal reproduction project and the GodotTools.Ides.MessagingServer and GodotTools.Ides.GodotIdeManager._Ready() entry points named in the report. Compare shutdown with and without generated .csproj/.sln files, then verify that a project containing [dotnet] metadata but no C# project exits normally without force quitting.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, godot
Domain
desktop, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.