"Godot, or to dog... is it even a question?"
Bring your existing C# Godot game to the web. Keep your scenes, scripts, and Godot workflow.
2dog packages Godot as a library hosted by your .NET application. That
inversion makes browser publishing, ordinary dotnet tooling, and first-class
xUnit testing possible without rewriting your game.
If you already build games with Godot and C#, most of your world stays exactly where it is:
- Your Godot project remains a Godot project and still opens in the editor.
- Your scenes, resources, C# scripts, signals, and exports keep working.
- You still use the familiar GodotSharp API.
- Asset import happens automatically during
dotnet build.
What changes is who holds the leash: your .NET process starts Godot, drives its main loop, and decides when it stops.
That unlocks a few useful tricks:
- ๐ C# games on the web: publish a static WebAssembly site with
dotnet publish. - ๐งช Real test projects: load scenes through xUnit and run headless in CI.
- ๐ A .NET-owned lifecycle: embed Godot in an app, server, tool, or custom host.
- ๐ฎ The full engine: scenes, physics, rendering, audio, input, and the GodotSharp API.
Both routes produce the same strongly recommended layout: the Godot project is the solution root, with desktop, browser, and test hosts nested inside it.
Convert in place. 2dog preserves your existing game content, and there is no
tool installation step. A classic .sln is migrated to .slnx when present:
dnx 2dog convert path/to/MyGame
cd path/to/MyGame
dotnet run --project MyGame.2dogRegister the project template once, then create the same complete layout from scratch:
dotnet new install 2dog
dotnet new 2dog -n MyGame
cd MyGame
dotnet run --project MyGame.2dogIn either case, your original Godot workflow is still there whenever you need it:
godot-mono --editor .The generated web host publishes your C# game as a static site. Install the .NET WebAssembly tools once, then publish and serve the bundle:
dotnet workload install wasm-tools
dotnet tool install --global dotnet-serve
dotnet publish MyGame.web
dotnet serve --directory MyGame.web/AppBundleSee Web / Browser for the development loop, deployment options, and current limitations.
MyGame/ Godot project and solution root
โโโ project.godot Scenes, scripts, assets, project settings
โโโ MyGame.csproj Godot C# game assembly
โโโ MyGame.2dog/ Desktop .NET host
โโโ MyGame.web/ Browser WebAssembly host
โโโ MyGame.tests/ Headless xUnit host
The nested hosts carry .gdignore, so Godot ignores them. Your game project
remains clean and editor-friendly while each host gets its own entry point and
dependencies.
Read The Recommended Project Layout for the complete mental model.
- Get Started: convert or create, run, test, and publish.
- Converting a Godot Project: understand exactly what
2dog convertchanges. - Web / Browser: publish your C# Godot game as a static site.
- Testing with xUnit: load scenes and run Godot headlessly in CI.
- Core Concepts: learn how .NET takes control of Godot.
- Configuration: configure project paths and native variants.
- API Reference: work directly with
EngineandGodotInstance.
Full documentation lives at 2dog.dev.
- .NET SDK 10.0 or later
- Godot .NET editor only when you want to edit scenes visually
- Supported platforms:
win-x64,linux-x64, andosx-arm64 - Packages are available on NuGet
The 2dog package contains the converter and project template.
Applications reference the 2dog.engine library; test projects add
2dog.xunit. Generated and converted projects configure these packages for
you.
Only one Godot instance can run in a process at a time. Sequential restart is supported: dispose the current instance before starting another. The supplied xUnit collections already serialize Godot fixtures correctly.
See Known Issues for details and workarounds.
Want to work on 2dog itself? Clone with submodules, then build the native and .NET packages:
git clone --recursive https://github.com/outfox/2dog
cd 2dog
uv run poe build-allRun the demo with dotnet run --project demo/demo.2dog and the tests with
dotnet test twodog.tests.
Questions, ideas, or particularly good sticks? Join the Dog Park: