C# Multi Project Setup

Godot Version

4.2.1

Question

I tried to setup a multi project solution with godot, but if the solution name and project are different, the project won’t build through the editor. On top of that, every so often the editor will decide to recreate the solution and break the project.

Ideally I’d like to have two godot projects in my solution, one for the games editor and one for the actual game. Having both in the solution will make sharing code easier.

Has anyone got a setup like this working?

3 Likes

After much struggling, I finally arrived at the same conclusion as OP – the assembly name of the project must match the solution name.

My example setup: A godot project contains a single solution. The solution contains two projects: (1) is game client code like UI or audio and (2) is a common library re-used outside the game client.

Although it’s just my personal opinion/fussiness, I would like the solution name to accurately reflect it contains two distinct projects.

Ideally, there is an additional, exposed knob under Project Settings>dotnet>Project>… Users may already specify the solution directory and the assembly name. What if we could instead specify a solution file?

It looks like there’s an open PR to get this addressed here.

https://github.com/godotengine/godot/pull/98807

Just ran into the same issue when trying to set up a unit test project. It took me a few reverts to realize the .sln and .csproj names had to match :joy:

1 Like