Godot normally loads .NET, now .NET loads Godot.
2dog packages Godot as a library (a slightly modified libgodot) hostable by .NET applications. Doing it like this enables browser publishing, ordinary dotnet tooling, and many automations like unit testing.
Pre-built native libraries are available for speed and convenience.
Oh btw., this means you can export Godot C# to the web using 2dog.
Full documentation at 2dog.dev.
2dog adds nested .NET hosts without moving your existing Godot project.
cd path/to/MyGame
dnx 2dog add # pick the hosts you want, then confirm
dotnet run --project MyGame.2dogRun dnx 2dog add again to add another host.
dnx 2dog new MyGame
cd MyGame
dotnet run --project MyGame.2dogThe package also provides a dotnet new template:
dotnet new install 2dog && dotnet new 2dog -n MyGame.
In either case, the familiar Godot workflow still works:
godot-mono --editor . # or Godot_v4.7.2-stable_mono_win64.exe, etc.The generated .NET app can also be published to browser-wasm (HTML5 / Web Browser)
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.
2dog mainly adds subdirectories with additional "hosts" that can run your Godot project. These use libgodot instead of the normal export templates or editor executable.
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. The game project
remains clean and editor-friendly while each host gets its own entry point and
dependencies.
- .NET SDK 10.0 or later, with the
wasm-toolsworkload - Godot 4.7.x official .NET editor (only when you want to edit scenes visually)
- Supported build platforms:
win-x64,linux-x64, andosx-arm64 - Supported RIDs for published builds:
win-x64,linux-x64,osx-arm64,browser-wasm - Packages available on NuGet and GitHub
π¦΄
- Forked
libgodotfeatures/fixes consist of similar amounts of human-written and machine-written code - Commits/PRs are reviewed & gated by both humans and machines (over 90%/90%) and signed by humans
- .NET Host applications are mostly human-written, while boilerplate assets (e.g. XAML) are mostly machine-written
- Configurations, tools, smoke tests, CSS, MSBuild XML, and CI workflows are overwhelmingly LLM-maintained
- Documentation aims to be human-authored, but new feature docs are generated and later gradually rewritten
- Releases on NuGet use Trusted Publishing and may only be invoked via direct human interaction
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 showcase with dotnet run --project demos/showcase/showcase.2dog and the tests with
dotnet test twodog.tests.
We've got a dedicated channel for 2dog, say hello!