Repository navigation
Commit 2c6819d
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) <noreply@anthropic.com>1 parent 371e96e commit 2c6819d
1 file changed
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
7 | 18 | | |
8 | 19 | | |
9 | 20 | | |
| |||
0 commit comments