Repository navigation
fix: Keep .uprimarker from posing as its assembly (net11 WASM startup) - #26292
Conversation
The marker items were built with an item transform from the package's assembly, so they inherited its DestinationSubPath, AssetType and PathInPackage. The .NET 11 WASM SDK keeps one asset per relative path, so the marker won `_framework/<Assembly>.dll` and the real DLL was dropped from the boot manifest. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TXMNtytE1VJhzMyGQcg5jf
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TXMNtytE1VJhzMyGQcg5jf
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
|
This pull request is merged. |
|
Claude finished @MartinZikmund's task in 15s —— View job Review of #26292Verdict: ship. No blocking issues, so I posted no inline comments. Issues by severity: 0 blocking, 0 major, 0 minor. What I checked (code review by inspection only; I did not build or run anything):
Non-blocking observations:
|
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
GitHub Issue: closes #26289
PR Type:
🐞 Bugfix
What changed? 🚀
Symptom
A
net11.0-browserwasmUno app never gets past the splash screen:Uno.UI.Runtime.WebAssembly.Browseris missing from the boot manifest (_framework/dotnet.js). The file deployed as_framework/Uno.UI.Runtime.WebAssembly.Browser.dllis actually the package's 132-byte.uprimarkertext file. The fourUno.Fonts.*assemblies are dropped in the same way: their 0-byte markers replace them. That doesn't block startup, but it's the same bug.Root cause (Uno side)
_UnoFindPackageAssetMarkersbuilds marker items with an item transform:An item transform copies all metadata from the source item, so each marker reaches
ReferenceCopyLocalPathsstill carrying its assembly's metadata:Foo.uprimarkerbefore this PRDestinationSubPathFoo.dllAssetTyperuntimePathInPackagelib/<tfm>/Foo.dllTo any downstream consumer, the marker looks like a second copy of
Foo.dll.Why it only breaks on .NET 11 (and why net10 is fine)
The WASM SDK's
ComputeWasmBuildAssetstask (inMicrosoft.NET.Sdk.WebAssembly.Pack) gives each candidate aRelativePathwithAssetsComputingHelper.GetCandidateRelativePath. That helper prefersDestinationSubPathwhen present. It's the same in 10.0.14 and 11.0.0-rc.3 (checked by decompiling both packs). So in both versions, the marker and the real DLL resolve to_framework/Foo.dll.The difference is what happens next:
Foo.wasm) and is listed in the boot manifest. The marker also ends up under the same path, but nothing loads it, so the problem stays hidden.HashSet<string>of relative paths and drops any later candidate whose path is already taken:The Uno target hasn't changed in years (it's the same in 6.7 and 7.0). It became fatal once the .NET 11 WASM SDK started deduplicating by relative path. That's why every Uno version fails on
net11.0-browserwasmand passes onnet10.0-browserwasm.Fix
Markers are now added to
ReferenceCopyLocalPathswith their own identity:DestinationSubPathbecomesFoo.uprimarker, so the marker no longer competes with the DLL for its slot.AssetTypeandPathInPackageare dropped, so no SDK treats the marker as a runtime assembly.PublishFolderType="None"are kept. Markers are still copied next to their assembly inbin/._UnoPriFiles,ExpandPackageAssets, reads justFullPath, so dropping the other metadata is safe.The fix is in the shared target, so it covers every head (not only WASM) and the
Xamarin-styleReferencepath as well. On non-WASM heads the only change is that the marker stops claiming its DLL's metadata, which was never correct.Tests
Given_PackageAssetMarkers(inUno.UI.Tasks.Tests) imports the realuno.ui.tasks.assets.targets, runs_UnoFindPackageAssetMarkersagainst a fake package containingFoo.dllandFoo.uprimarker, and readsReferenceCopyLocalPathsback withdotnet msbuild -getItem. It asserts that the marker hasDestinationSubPath=Foo.uprimarker, noAssetTypeand noPathInPackage, and still has itsNuGetPackageId.DestinationSubPathisFoo.dll.Validation
Given_PackageAssetMarkersfails before the fix and passes after it (run locally on net10.0).ComputeWasmBuildAssetsandAssetsComputingHelperfromMicrosoft.NET.Sdk.WebAssembly.Pack10.0.14 and 11.0.0-rc.3.26522.148 to confirm the sharedDestinationSubPath-based relative path and the .NET 11-only dedup.net11.0-browserwasmapp build locally because thewasm-toolsworkload for the 11.0 rc SDK isn't installed on this machine.PR Checklist ✅
Screenshots Compare Test Runresults.🤖 Generated with Claude Code
https://claude.ai/code/session_01TXMNtytE1VJhzMyGQcg5jf