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.
| Property | Default | Purpose |
|---|---|---|
TwoDogExportPack | true | Export content to an executable-adjacent .pck; false skips export, so supply game content separately |
TwoDogDesktopExportPreset | Windows Desktop | Preset in export_presets.cfg for the Windows game pack |
PublishSelfContained | true in the generated host | Bundle the .NET runtime; false requires an installed runtime |
PublishAot | false | Compile 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=trueNative 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.