Repository navigation
Description
Description
The source-generator incremental XAML Hot Reload writer currently declines several element-valued, attached, and collection-shaped mutations instead of reconciling the existing live object graph. Generated UpdateComponent code emits explicit skipped/untouched markers, so the app remains running, but the requested edit is not applied.
The affected behavior families share one architectural requirement: rebuild or reconcile a complex subtree while preserving lifecycle semantics and current runtime state. The planned regression suite in #36730 covers:
- active
VisualStateManager.VisualStateGroupssetter edits and state add/remove/re-add fallback Behaviorsremove/re-add with exactly-once detach/attach- merged dictionary reorder/removal and winner recomputation
Style.BasedOnand trigger removal/re-attachmentMultiBindingchild remove/re-add without duplicate expressionsBindableLayout.ItemTemplatereplacement without duplicate generated children- non-root/nested resource dictionaries and custom converter resources
These are intentionally tracked together because fixing them independently with ad hoc assignments would risk stale state, duplicate subscriptions, orphaned children, or incorrect resource precedence.
Steps to Reproduce
- Enable source-generator incremental XAML Hot Reload on the
net11.0branch. - Create a live page containing one of the structures above, for example a
Labelin an active visual state with aBackgroundColorsetter. - Apply a XAML update that changes the active setter, removes and re-adds the state, reorders merged dictionaries, removes/re-adds a behavior, or changes another complex collection.
- Inspect the generated
UpdateComponentsource and the retained live object.
Expected: the edit is applied to the retained object; removal restores the correct local/style/default fallback; re-add creates one current object/subscription; current state and unrelated object identity are preserved.
Actual: generated code emits an explicit complex-property/attached-property skipped or untouched marker and the live graph keeps the previous structure/state.
Draft PR #36730 adds green documentation guards plus skip-gated live probes for these scenarios so each can be enabled as reconciliation support lands.
Link to public reproduction project repository
Version with bug
Nightly / CI build (current net11.0 source-generator incremental Hot Reload implementation)
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
iOS, Android, Windows, and macOS. The gap is in cross-platform generated update code; individual handler/host effects may vary.
Affected platform versions
Not platform-version-specific.
Did you find any workaround?
Use a full rebuild/restart for these structural edits. The generator intentionally declines unsupported mutations rather than emitting a potentially corrupt partial update.
Relevant log output
Generated UpdateComponent output contains comments such as Complex property '<name>' ... skipped (not yet supported), Complex attached property '<name>' ... skipped, or resource entries marked untouched.
Activity
Add Wave-2 Phase-1 resource/theme hot reload tests (RT-01..RT-07)
[SourceGen.UnitTests] Wave-2 template/selector hot-reload tests (TS-0…
Add Wave-2 nested/custom-control hot reload tests (NC-01..NC-03)
Promote NC-03 nested hot reload test to GREEN
Add Wave-2 Phase-2 resource/theme hot reload tests (RT-08..RT-11)
XAML Hot Reload: Improve incremental generation and coverage (#36730)
Fix SourceGen hot reload for application resources (#37896)
noiseonwires commentedon Nov 6, 2026
Adding measured follow-up evidence on the build containing #39928. These are managed generator/runtime results, not a claim that every case was manually tested in a native VS/watch UI session.
Exact environment and methodology
11.0.100-rc.3.26522.148/11.0.0-rc.3.26522.148.11.0.10-ci.pr39928.26555.75.1866354d267f3934c08f27eba64f6bbd476123aa(PR [XAML] Refresh implicit styles after incremental Hot Reload setter edits #39928 CI merge).net11.0on Windows.For each case: generate/compile the baseline; make one edit on a single linear generator driver; generate/compile the edited XAML independently as the fresh-build oracle; create retained consumers; emit and apply a real metadata/IL/PDB delta with
MetadataUpdater.ApplyUpdate; invoke MAUI's actualXamlIncrementalHotReloadHandler.UpdateApplication; compare retained state and identity with the independent new build. UI dispatch uses MAUI's synchronous main-thread test hook, as in upstream managed XIHR tests.Each of 41 scenarios ran twice with matching results. The driver is not forked or evaluated speculatively, intentionally isolating these coverage gaps from #36937.
Structural/reconciliation cases relevant here
ContentPage.ResourcesStaticResource,DynamicResource, Binding, or Color elementSourcePositive controls: scalar edits in root implicit styles (including classless
Source=dictionaries, an existing BasedOn, and non-shared resources) pass; direct keyed Color + DynamicResource passes; simple Text edits in materialized DataTemplate and ControlTemplate children pass. In particular, this is not a blanket claim that templates or dictionary updates never work.Changing
Style.TargetTypeproduces a different, isolated compiler defect (incremental CS0200 for a read-only assignment, clean edited build succeeds); filed separately as #39983. Keyed/class style scalar edits and lazy-vs-eager brush mutations are being separated into focused reports rather than treating every matrix row as a distinct bug.Complete minimal example: merged-dictionary winner is not recomputed
Use the exact package above in a MAUI app, enable Debug XIHR, and make
Cases.TestPagethe startup page. These are also the inputs for the verified generator/runtime case.A.xaml:B.xaml: identical except<Color x:Key="Accent">Blue</Color>.Styles.xaml:TestPage.xaml:Code-behind:
Sourceto A, or clearing B's Accent key. Those also leave the retained winner stale in the managed tests.The reorder update contains an explicit marker:
// Complex root property 'MergedDictionaries' (ListNode) — skipped (not yet supported)Additional isolated shape: active VisualState setter
In a root implicit Label Style use:
Activate
VisualStateManager.GoToState(label, "Selected")and verify Red before the edit. Change only this active state's Setter.Value to Blue. After the real delta and XIHR handler, the retained managed Label stays Red; independently rebuilding and activating Selected gives Blue. This differs from editing an ordinary direct Setter in an implicit Style that happens to contain visual states; the latter can use #39928's replacement path.Scope cautions
Generated before/after patches, input XAML, fresh-build observations, and per-case repeated results were saved. These failures should be grouped by resource ownership/reconciliation mechanism rather than filed as one issue per row.
Fix resource additions in SourceGen Hot Reload (#39826)
Fix resource additions in SourceGen Hot Reload (#39826)
Fix resource additions in SourceGen Hot Reload (#39826)
Fix resource additions in SourceGen Hot Reload (#39826)
Fix resource additions in SourceGen Hot Reload (#39826)
Fix resource additions in SourceGen Hot Reload (#39826)
Fix resource additions in SourceGen Hot Reload (#39826)
Fix resource additions in SourceGen Hot Reload (#39826)
Fix resource additions in SourceGen Hot Reload (#39826)
Fix resource additions in SourceGen Hot Reload (#39826)
Fix resource additions in SourceGen Hot Reload (#39826)
Fix resource additions in SourceGen Hot Reload (dotnet#39826)