Skip to content

2dog doctor

Checks the project and this machine without building, and applies the fixes it can. Static by default; works offline. Fix classes, the interactive checklist and a sample run: Doctor and Update.

bash
2dog doctor [path] [options]
ArgumentMeaning
pathDirectory containing project.godot; defaults to the current directory

Options

OptionEffect
--fixApply the safe fixes, then check again
--fix-allAlso apply the announced fixes: solution migration, target framework, bootstrap refresh
--build [target]Run dotnet build of the solution, or a host folder or project, and explain known failures
-c, --configuration <Cfg>Configuration for --build (default Debug)
--log <file>Only explain an existing build, restore or runtime log; - reads stdin
--ignore <id>Drop a finding by check id; repeatable
--strictWarnings count as findings for the exit code
--offlineSkip the nuget.org check for a newer tool
--list-checksPrint every check and build-log signature

Plus the global and output options; -v lists the passed checks too.

Exit codes

CodeMeaning
0Only informational items remain
2Doctor could not run: no project.godot, unreadable files
3Errors remain (warnings too under --strict), or the --build failed

Examples

bash
2dog doctor                                         # check, then ask which fixes to apply
2dog doctor --fix                                   # apply the safe fixes unattended
2dog doctor --build MyGame.web -c Release           # build one host and explain failures
2dog doctor --log build.log                         # explain an existing log
dotnet build 2>&1 | 2dog doctor --log -             # or a piped one
2dog doctor --json --strict | jq '.doctor.summary'  # CI: exit 3 on any warning

Checks

Ids are stable; --ignore <id> drops one.

Environment

IdPasses when
env.dotnet-sdka .NET 10 SDK is installed
env.global-jsonthe root global.json pin is satisfied by an installed SDK
env.wasm-toolsthe wasm-tools workload is installed when a browser host exists
env.host-platformthis OS and architecture have 2dog native packages
env.godot-editorGODOT_EDITOR, when set, points at an existing file
env.overridesGODOTSHARP_DIR and the other layout overrides point at what they claim
env.packages-restoredthe engine, tools and native packages are in the NuGet cache

Layout

IdPasses when
layout.load-problemsevery project file parses
layout.game-csprojthe game csproj exists at the project root
layout.assembly-nameproject.godot names the assembly and the csproj matches it
layout.multiple-root-csproja single csproj at the root, or assembly_name picks one
layout.spaced-namethe .NET project name contains no whitespace
layout.legacy-root-webbootTwoDogWebBoot.cs lives in a web host folder, not at the root
layout.root-build-targetsDirectory.Build.targets provides the deep-clean target
layout.root-build-propsDirectory.Build.props holds the shared package versions
layout.root-global-jsonglobal.json pins a wasm-capable SDK when a browser host exists

Game csproj

IdPasses when
game.sdkthe game csproj uses Godot.NET.Sdk
game.sdk-mismatchGodot.NET.Sdk matches the Godot line 2dog.engine was built for
game.target-frameworkthe game csproj targets net10.0
game.propertiesEnableDynamicLoading, AllowUnsafeBlocks and LIBGODOT_ENABLED are set
game.default-item-excludesevery host folder is excluded from the game's default globs
game.webboot-includethe web bootstrap is compiled into the game assembly
game.webboot-duplicateexactly one TwoDogWebBoot.cs compiles into the game assembly

Hosts

IdPasses when
host.gdignoreevery host folder carries a .gdignore
host.project-referenceevery ProjectReference points at an existing project
host.godot-project-dirGodotProjectDir points at the Godot project
host.variantTwoDogVariant is release, debug or editor
host.buildtype-deprecatedthe deprecated TwoDogBuildType property is gone
host.publish-aotno desktop host enables PublishAot or PublishSingleFile
host.duplicate-analyzershosts referencing the game strip the duplicate Godot analyzers
host.app-manifestthe app.manifest a host declares exists
host.web-props-shimbrowser hosts chain to the root Directory.Build.props
host.web-global-jsonbrowser hosts carry their own global.json
host.webboot-driftthe tool-owned TwoDogWebBoot.cs matches this tool's copy
host.trimmer-rootbrowser hosts root the game assembly for the trimmer
host.blazor-clientthe Blazor client project exists and publishes 2dog.engine
host.windows-onlyWindows-only hosts are noted on other platforms

Solution

IdPasses when
sln.existsa solution exists at the project root
sln.multipleexactly one solution contains the game project
sln.legacy-formatthe solution uses the .slnx format
sln.contains-gamethe solution lists the game project
sln.contains-hoststhe solution lists every host project
sln.build-exclusionsbrowser and WinUI hosts are excluded from plain solution builds

Versions

IdPasses when
ver.managed-elsewhereversions expressed through your own properties are noted, not judged
ver.props-invalidthe TwoDog* versions in Directory.Build.props are readable versions
ver.literal-versionshost csprojs use the shared version properties, not literals
ver.twodog-consistentevery 2dog package uses the same version
ver.twodog-outdatedthe 2dog packages are at this tool's version
ver.twodog-newerthe project is not ahead of this tool
ver.nativesthe native packages are exact-pinned on the engine's Godot line
ver.godot-line-consistentTwoDogGodotVersion matches the game project's Godot.NET.Sdk
ver.godotsharp-editorGodotSharpEditor in the test host matches the Godot.NET.Sdk
ver.companionsAvalonia and the other companion packages are not mixed
ver.tool-latesta newer 2dog tool on nuget.org is mentioned

Presets

IdPasses when
preset.fileexport_presets.cfg exists
preset.webthe 'Web' preset exists when a browser host does
preset.desktopthe per-OS desktop presets exist

Godot settings

IdPasses when
godot.features-lineconfig/features names the Godot line the SDK targets
godot.xr-shadersa WebXR host has xr/shaders/enabled.web set
godot.import-stampthe project has been imported at least once

Build-log signatures

Failures --build and --log recognize. A match gets a title, the offending line and the fixing command; other errors follow.

IdFailure
build.variant-invalidTwoDogVariant is not release, debug or editor
build.buildtype-deprecatedthe deprecated TwoDogBuildType property is set
build.publish-aotPublishAot is not supported for desktop hosts
build.publish-singlefilePublishSingleFile is not supported for desktop hosts
build.godot-sdk-mismatchGodot.NET.Sdk and 2dog.engine are on different Godot lines
build.no-import-capabilityno import capability (2dog.<rid>.editor and 2dog.tools packages missing)
build.import-requiredthe build requires an import (TwoDogRequireImport=true) and has no import capability
build.desktop-preset-missingthe desktop export preset is missing from export_presets.cfg
build.web-preset-missingthe 'Web' export preset is missing from export_presets.cfg
build.no-export-capabilityno export capability (2dog.<rid>.editor and 2dog.tools packages missing)
build.web-payload-missingthe browser natives (2dog.browser-wasm) are not restored
build.native-missingthe native libgodot for this platform was not found
build.nu1213the '2dog' tool package is referenced as a library
build.package-not-founda package version is missing from the feeds
build.version-conflictconflicting package versions across the solution
build.msb3277-godotsharptwo GodotSharp versions meet in one build
build.wasm-tools-missingthe wasm-tools workload is not installed
build.sdk-too-oldthe installed .NET SDK is too old for net10.0
build.global-json-unresolvedno installed SDK satisfies global.json
build.godot-sdk-not-foundthe Godot.NET.Sdk version could not be downloaded
build.webboot-duplicateTwoDogWebBoot.cs compiles twice into the game assembly
build.il1035the trimmer cannot see a root assembly
build.export-failedthe Godot pck export failed
build.godotplugins-missingGodotPlugins.dll not found at runtime
build.native-variant-missingthe native library for this TwoDogVariant is missing at runtime
build.variant-fallbackthe engine fell back to another native variant