Skip to content

Avalonia Configuration ​

Set properties in MyGame.avalonia.csproj. 2dog.avalonia brings in 2dog.engine; global settings control the game directory, resource import, analyzers, and native variant.

PropertyDefaultPurpose
TwoDogExportPacktrueExport content to an executable-adjacent .pck; false skips export, so supply game content separately
TwoDogDesktopExportPresetRID-mappedWindows Desktop, Linux, or macOS, according to the publish target
PublishSelfContainedtrue in the generated hostBundle the .NET runtime; false requires an installed runtime
PublishAotfalseCompile the host and managed game code into a native executable
bash
dotnet publish MyGame.avalonia -c Release -r win-x64 -p:PublishAot=true

Native AOT supports debug and release variants; see requirements and trimmer roots. The generated host uses OutputType=WinExe; choose Exe to see the engine's console diagnostics on Windows. Keep its app manifest for correct DPI scaling.

See the Avalonia host guide for UI setup and platform requirements.