From a7af80e0117a3b26733b052cd726a658f1fdd43e Mon Sep 17 00:00:00 2001 From: Martin Zikmund Date: Mon, 22 Jun 2026 09:21:40 +0200 Subject: [PATCH] Fix WASM gallery startup (splash stall / blank) by forcing UnoRuntimeIdentifier The WASM head sets TargetFramework late, via App.Head.Wasm.props imported in the project body, after NuGet's generated .nuget.g.props has already been evaluated. That generated file imports Uno.(UI|WinUI).Runtime.WebAssembly.props - which sets UnoRuntimeIdentifier=WebAssembly - inside an ImportGroup gated on "'$(TargetFramework)' == 'net9.0'". Since TargetFramework is still empty when .nuget.g.props is evaluated, the import is skipped and UnoRuntimeIdentifier is never set. With UnoRuntimeIdentifier empty, Uno's ReplaceUnoRuntime target (gated on UnoRuntimeIdentifier != '') does not run, so the platform-agnostic reference Uno.UI.dll (lib/, no embedded JS) is deployed instead of the uno-runtime/.../webassembly implementation that embeds Uno.UI.WasmScripts.Uno.UI.js. The bootstrapper therefore has no Uno runtime JS to load, globalThis.Uno.UI is never registered, Application.Start's callback is never invoked, and the gallery hangs on the splash screen (WinUI 2 / Uno.UI) or shows blank (WinUI 3 / Uno.WinUI). This regressed in the net8 -> net9 migration that flipped the head SDK from Microsoft.NET.Sdk.Web to Microsoft.NET.Sdk.WebAssembly. Set UnoRuntimeIdentifier=WebAssembly and UnoIsWebAssemblyBrowserHead=true explicitly in App.Head.Wasm.props so the runtime-assembly swap runs regardless of NuGet import timing. Verified end-to-end (gallery renders, 2386 XAML elements) for both Uno.UI/WinUI 2 and Uno.WinUI/WinUI 3. Co-Authored-By: Claude Opus 4.8 (1M context) --- ProjectHeads/App.Head.Wasm.props | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ProjectHeads/App.Head.Wasm.props b/ProjectHeads/App.Head.Wasm.props index 9861b527..ed7c9705 100644 --- a/ProjectHeads/App.Head.Wasm.props +++ b/ProjectHeads/App.Head.Wasm.props @@ -4,6 +4,17 @@ $(WasmHeadTargetFramework.Split(';')[0]) + + + WebAssembly + true + +