Skip to content

WinForms Configuration ​

Set properties in MyGame.winforms.csproj, which references 2dog.engine. The generated host targets net10.0-windows with UseWindowsForms=true. 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
bash
dotnet publish MyGame.winforms -c Release -r win-x64

WinForms does not support trimming or Native AOT. Keep the generated ApplicationHighDpiMode=SystemAware and app manifest so WinForms and Godot use the same DPI mode. The host uses OutputType=WinExe; choose Exe to see console diagnostics.

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