Skip to content

WinUI 3 Configuration ​

Set properties in MyGame.winui.csproj, which references 2dog.engine and Microsoft.WindowsAppSDK. Build and publish on Windows. 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
TwoDogDesktopExportPresetWindows DesktopPreset in export_presets.cfg for the Windows game pack
PublishSelfContainedtrue in the generated hostBundle the .NET runtime; false requires an installed runtime
PublishAotfalseCompile the host and managed game code into a native executable

The generated host sets RuntimeIdentifier=win-x64, WindowsPackageType=None, and WindowsAppSDKSelfContained=true for an unpackaged app carrying its Windows App SDK runtime. That runtime setting is separate from .NET's PublishSelfContained.

bash
dotnet publish MyGame.winui -c Release -p:PublishAot=true

Native AOT supports debug and release variants; see requirements and trimmer roots. The host uses OutputType=WinExe; choose Exe to see console diagnostics.

See the WinUI host guide for window embedding and UI behavior.