Have multiple .NET projects (.csproj) in game solution (.sln)

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By jahu00

I’m making a new multiplayer Godot 4 project with .NET and I expect that eventually I’m going to need more than one .NET project inside my solution (ie. have a standalone server binary). It appears that currently csproj file is placed in the same location as sln file. Is there some way to have csproj file in a subfolder, so I can have more projects in my solution?

I tried moving the project to a subfolder and tried changing binary output path to match the one it had when both sln and csproj were n the same folder, but that didn’t work (.NET code was not executed). When I keep the layout vanilla, .NET code does work.

:bust_in_silhouette: Reply From: jahu00

I found a way that is partially successful. I might have been unable to move the csproj file to a subfolder, but if I moved everything but the sln to a subfolder, I can have the solution layout that I was looking for. With this layout it might be even possible to have multiple Godot projects in one solution (like having a game in one project and editor in another).

There is a catch though. Once the sln file is placed in parent folder, Godot fails to open cs scripts in VisualStudio. This is something I can probably live with, but is an annoyance all the same.

Apparently there is a built in option for setting solution this way. In project settings, Advanced Settings have to be enabled, then the Dotnet project settings become available. There Solution directory can be set to

jahu00 | 2023-03-16 21:57