Skip to content

Blazor Configuration ​

Set 2dog properties in MyGame.blazor/Client/MyGame.blazor.Client.csproj. The client references 2dog.engine, 2dog.blazor, and 2dog.browser-wasm. It normally sets GodotProjectDir=../..; see the global settings.

Client Properties ​

PropertyDefaultPurpose
TwoDogWebVariantFollows the configurationNative engine variant: debug or release
TwoDogExportPacktrueExport the game pack as a static web asset; false uses an existing wwwroot/godot.pck in the client
TwoDogWebExportPresetWebPreset in export_presets.cfg
TwoDogWebPackNamegodot.pckExported pack name; if you change it, set the same name in GodotView.PackUrl
TwoDogWebSideModuleExportstrueExport native symbols used by GDExtensions
WasmEmitSymbolMapfalse in Release, true otherwiseInclude native symbols for stack traces; explicit settings override the default
WasmInitialHeapSize256MBInitial memory allocation; memory can grow

2dog.browser-wasm restores both supported native variants. If the payload for the selected variant is missing, the build fails. The client SDK manages its own bundle, progress, source maps, and compression. TwoDogWebSizeManifest, TwoDogWebStripMaps, and TwoDogWebPrecompress apply only to Web and WebXR hosts.

Publishing, Trimming, and AOT ​

Publish the server project to include its client:

bash
dotnet publish MyGame.blazor -c Release -p:RunAOTCompilation=true

RunAOTCompilation enables Mono's browser AOT compiler. See Trimming for assemblies accessed only through reflection.

Keep the attributes on the client's generated 2dog.engine and browser package references. See the Blazor host guide for GodotView.

Experimental WebGPU ​

See New Tricks: WebGPU for GodotView renderer settings, browser requirements, and Compatibility fallback. See Forward+ and Mobile on the web to select the web renderer and bake shaders before export.

2dog is Free and Libre Open Source under the MIT License.
2dog is not affiliated with or endorsed by the Godot Foundation.
Godot is licensed under the MIT License; the Godot logo is by Andrea Calabró under CC BY 4.0. @icons made by Voxy under the MIT License.
Continuous Integration compute graciously supported by Blacksmith.