+1 vote

I am on Ubuntu and have created a Godot Mono (3.2.2 Stable) Project, with some C# node scripts.

I would like to encapsulate much of the game logic in C# classes that are not tied to Godot Nodes. It is straightforward to manually create .cs files and add them to the game.csproj file so they are compiled.

The next step is to create 2-3 more C# projects, one for unit tests, and one to run game logic on a server. Neither of these projects will depend on Godot C# libraries. (End goal is running the game logic on a lean web server with no godot dependancy)

I am a professional C++ developer, but am new to C#. What tools exist to help me set up these projects on linux? I have Mono, MSBuild, and Nuget installed. I am comfortable with command line tools. csproj files appear to be manually modifiable, but .sln files do not. Google searching different permutation of "mono setup project solution c# linux etc." has not been fruitful.

How can I:

  1. Create a "GameLogic" library project
  2. add the GameLogic library project as a dependency of the GodotProject (so I can use classes from it in node scripts)
  3. Create a "Testing" unit test project (preferably with mstest, nunit, or xunit), with the GameLogic library linked as a dependency
  4. Create a "GameServer" executable project, with the GameLogic library linked as a dependency

I have tried Visual Studio Code with the C# Extension, but it does not seem to have the tooling to create/manage C# solutions/projects.

in Engine by (15 points)
edited by

1 Answer

0 votes
mkdir test
cd test
dotnet new classlib
by (1,661 points)

Is the dotnet tool not part of the .NET core package? Or is there a mono-compatible dotnet tool as well?

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.