Repository navigation
Description
What is broken
The MetadataUpdate hot-reload suite in Uno.UI.SourceGenerators.Tests — the only end-to-end workbench we have for XAML codegen × Edit-and-Continue — does not run at all on master. It is not failing; it is not compiled.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/Uno.UI.SourceGenerators.Tests.csproj:
<!-- Disabled until the net10 Roslyn 5.x migration (follow-up PR): these consume Uno.HotReload
(5.x), incompatible with the temporary 4.14.0 pin. -->
<Compile Remove="MetadataUpdateTests\Given_HotReloadService.cs" />
<Compile Remove="MetadataUpdates\HotReloadWorkspaceProvider.cs" />…plus the Uno.HotReload ProjectReference commented out further down, and Microsoft.CodeAnalysis pinned back to 4.14.0 with a TEMPORARY marker.
Verified on master @ e34e85017b:
Uno.UI.SourceGenerators.Testsdiscovers 232 tests, zero of them theHRscenario test. The ~30 scenario folders underMetadataUpdateTests/Scenarios/are still copied to the output directory, so nothing signals that they stopped executing.Uno.HotReload.Tests(the other suite, unaffected) is healthy: 146/146 green in 4.5 s on Linux against the net10 / Roslyn 5.6 embed.
How it got here
Disabled in ea42f022c5 (2026-07-28) as a deliberate, separately-committed consequence of spec 053 R2 (PR #23863): NuGet cannot restore a 4.14-pinned test project against the 5.6-pinned Uno.HotReload (NU1107). The spec states the intent explicitly:
The follow-up PR migrates the test project to 5.x, regenerates the snapshot baselines (checksum algorithm SHA1→SHA256 and generated-file ordering changed; the regeneration harness is Windows-only), and re-enables the suite; the branch with the 5.x re-enable groundwork is prepared.
That follow-up PR was never opened, and nothing tracked it — hence this issue.
Why this is urgent now
This suite is the workbench needed to work on unoplatform/uno.hotdesign#7669 / dotnet/roslyn#77224 — ENC1002 / ArgumentException: An item with the same key has already been added. Key: …DeletedPEMethodDefinition when a XAML edit deletes generated lambdas. Roslyn only builds DeletedPEMethodDefinition for deleted synthesized methods (GetDeletedSynthesizedMethods), so the trigger is our generated closures disappearing — precisely what these scenarios exercise, and precisely the kind of thing we have historically fixed by reshaping codegen (e.g. 9ca0256d00, which moved ComponentHolder out of field-initializer position for exactly this class of reason).
Two concrete consequences of the suite being off:
- We cannot iterate on docs: Update vs2022 getting started #7669 headlessly. With the suite running, a scenario folder is 5 files and the crash surfaces as a plain test failure —
HotReloadWorkspace.Update()callsEmitSolutionUpdateAsyncwith notry/catch, so the Roslyn exception propagates with its real stack. Without it, the only repro path is Windows + VS + a running app. When_Page_Res_xBind_Removecannot be re-examined. That scenario is already flagged"IsCrashingRoslyn": trueand skipped viaAssert.Inconclusive. Its step 0 hasColor="{x:Bind MyColor}", step 1 replaces it with a literal — i.e. it deletes generated lambdas, the same shape as docs: Update vs2022 getting started #7669. It may well be the same crash, already sitting in our tree, and we currently have no way to check.
Beyond #7669: the whole XAML-codegen × EnC surface has had no CI coverage since 2026-07-28. Any hot-reload codegen regression landing in that window is unguarded.
What needs to be done
- Migrate
Uno.UI.SourceGenerators.Teststo the net10 / Roslyn 5.x line (drop theTEMPORARY4.14.0 pin). - Regenerate the committed source-generator snapshot baselines — the checksum algorithm changed SHA1→SHA256 and generated-file ordering changed. Note: the regeneration harness is Windows-only.
- Restore the two
Compile Removed files and theUno.HotReloadProjectReference. - Land the prepared 5.x re-enable groundwork branch mentioned in spec 053.
Acceptance criteria
-
Given_HotReloadService.HRis discovered and runs — the ~30 existing scenarios execute in CI, on the same Roslyn line the dev-server host embeds (5.6 for net10). - Snapshot tests pass without local regeneration.
- A CI guard (or a test) fails if the suite silently stops being discovered again — the current failure mode was invisible because the scenario data kept being copied to the output directory.
-
When_Page_Res_xBind_Removeis re-run withIsCrashingRoslynremoved and the outcome recorded: either it passes, or its exception is captured and linked to EnC: ArgumentException: An item with the same key has already been added. dotnet/roslyn#77224.
Anything else
- spec:
specs/053-hotreload-workspace-analyzer-flavor-skew/spec.md(R2 consequence section). - Related: unoplatform/uno.hotdesign#7669, EnC: ArgumentException: An item with the same key has already been added. dotnet/roslyn#77224, [EnC] Make syntax offsets more version resilient dotnet/roslyn#82903.
Activity
fix(hr): make the XAML snapshot harness run on Windows too (#24071)
test(hr): stop a test from pinning the harness config (#24071)
test(hr): ignore the 12 known hot reload failures (#24071)
test(hr): re-enable the MetadataUpdate hot-reload suite on Roslyn 5.6 (…
test(hr): make the MetadataUpdate hot-reload harness run on Linux (un…
test(hr): make the XAML generator snapshot fixture host-independent (u…
fix(hr): make generated code-behind line endings deterministic (unopl…
fix: Resolve merge conflicts with master
test: Realign branch-added snapshots with the //Project fixture