Skip to content

XAML Hot Reload: Improve incremental generation and coverage - #36730

Merged
kubaflo merged 26 commits into
net11.0from
redth-hot-reload-test-harness
Jul 30, 2026
Merged

XAML Hot Reload: Improve incremental generation and coverage#36730
kubaflo merged 26 commits into
net11.0from
redth-hot-reload-test-harness

Conversation

@Redth

@Redth Redth commented Jul 22, 2026

Copy link
Copy Markdown
Member

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Description of Change

This PR improves incremental XAML Hot Reload source generation and expands deterministic coverage for generator, compilation, and in-process metadata-update behavior.

  • Preserves supported complex properties such as CollectionView.ItemTemplate when an update replaces a root element.
  • Buffers diagnostics from speculative source generation so rejected attempts do not leak or duplicate diagnostics.
  • Conservatively emits the existing explicit skipped (not yet supported) marker for inline-resource and StaticResource-dependent complex-property subtrees that cannot be resolved safely in the isolated speculative context.
  • Adds a reusable source-generator Hot Reload harness for strict or diagnostic-tolerant generation, compilation, live metadata updates, chained deltas, multiple XAML documents, optional stable C# inputs, multiple retained instances, and application-host resource/theme scenarios.
  • Reorganizes the larger AI-assisted behavior suites into logical partial-class files while preserving their fully qualified test names.

Root Cause and Wave-1 Fix

UpdateComponentCodeWriter could create a newly added replacement root, but it skipped element-valued properties instead of applying the same value-creation and property-setting pipeline used by InitializeComponent. That silently dropped properties such as CollectionView.ItemTemplate in #36256.

The replacement-root path now speculatively emits supported complex properties and assigns them to the existing live page. The #36256 coverage verifies both generated source/compilation and a real metadata update on the same page instance, including a non-null CollectionView.ItemTemplate whose content contains the updated label.

Speculative generation introduced two safety constraints:

  • Diagnostics must remain isolated until emission is accepted. SourceGenContext now supports explicit diagnostic buffering, flush, and discard behavior.
  • A fresh speculative context cannot safely resolve ancestor resources or run the complete resource pipeline. Inline resources and direct, nested-markup, or element-form StaticResource references are therefore declined explicitly instead of producing a compileable false-success update that fails or resolves to null at runtime.

Only the expected unsupported InvalidOperationException falls back to the skip marker; unexpected exceptions continue to propagate.

#36157 is covered only at the generator boundary: malformed-to-repaired input recomputes generator diagnostics and the repaired output compiles. This does not claim IDE Error List, Roslyn edit-session, or dotnet watch recovery. #36156 remains deferred to an IDE/Roslyn host test because its rude-edit session-poisoning behavior cannot be reproduced faithfully by a generator unit test.

Reusable Hot Reload Harness

The harness:

  • keeps one incremental generator driver and advances the Roslyn EmitBaseline through successive deltas;
  • gives each scenario unique assembly, XAML path, and collectible AssemblyLoadContext identities;
  • supports generation-only, compile-only, and full live-update paths;
  • supports diagnostic-tolerant versions, multiple XAML documents, optional stable C# sources, and multiple retained roots;
  • uses metadata-aware fact and theory attributes so live-update tests skip, rather than fail, when the runtime does not support MetadataUpdater.ApplyUpdate;
  • resets XamlHotReloadState, restores Application.Current, unregisters roots from XamlComponentRegistry, disposes metadata/streams, and unloads the collectible context.

Generated x:Name fields still require manual C# stubs because CodeBehindCodeWriter is outside this harness.

Wave-2 Coverage

The living AI-assisted index accounts for 55 test methods across 35 behavior IDs/capabilities covering:

  • dynamic and merged resources, styles, themes, and application resources;
  • visual states and behaviors;
  • data/control templates, selectors, compiled bindings, and BindableLayout;
  • bindings, markup extensions, and MultiBinding;
  • nested generated controls and namescopes;
  • multi-document and cross-assembly generator invalidation.

The metadata-enabled AI-assisted run reports 41 passed, 18 intentionally skipped, and 0 failed. Theory rows affect the reported case count.

Passing tests are classified as live, construction, generator/compile guards, or explicit decline guards. Each skip-gated RED-PROBE names a nearby executable passing guard. The 18 skipped probes encode desired behavior for known gaps; they are not claimed as passing runtime coverage.

The larger resource/theme, visual-state, template, binding/markup, and nested-control suites are split into behavior-named partial files for reviewability without changing xUnit discovery, attributes, fixtures, or method identities.

Known Limitations and Deferred Lanes

  • A compiled ResourceDictionary Source= payload is unavailable in the in-memory collectible load context. Multi-document and Source= tests therefore verify tracking, generation, and compilation; their live payload probes remain skip-gated.
  • Cross-assembly tests cover incremental-generator reference invalidation and caching only. Applying deltas to a separately loaded runtime assembly remains an integration lane.
  • IDE/Hot Reload host behavior, Roslyn rude-edit recovery, dotnet watch, devices, native handlers, rendered output, and lifecycle behavior remain integration/host lanes.
  • The AppThemeBinding live probe remains skip-gated because the current update writer supplies an IProvideValueTarget with a null TargetProperty; its passing guard proves generated branch capture only.
  • Future keyed-template and selector factories remain tracked by [XAML Hot Reload] SourceGen HR: successive DataTemplate edits under dotnet watch crash the app / poison HR / kill the watcher (PR #34338) #36482. Passing construction/source guards do not prove post-update future realization.
  • Complex-property and collection reconciliation remains tracked by [XAML Hot Reload] Reconcile complex property and collection updates #36732. Explicit decline guards prove that unsupported updates are skipped and compile, not that live reconciliation succeeds.

What NOT to Do

  • Do not send speculative visitor diagnostics directly to the production diagnostic sink; rejected attempts must discard them.
  • Do not emit resource-dependent subtrees from an isolated context and treat successful compilation as proof of runtime resolution.
  • Do not catch broad exceptions and silently degrade unexpected generator failures.
  • Do not use generated-source markers as evidence of live runtime behavior.
  • Do not treat generator-only recovery coverage as proof of IDE or dotnet watch recovery.

Issues Fixed

Fixes #36256

Related coverage and roadmap issues:

Test Coverage

DOTNET_MODIFIABLE_ASSEMBLIES=debug dotnet test src/Controls/tests/SourceGen.UnitTests/SourceGen.UnitTests.csproj -c Debug
DOTNET_MODIFIABLE_ASSEMBLIES=debug dotnet test src/Controls/tests/SourceGen.UnitTests/SourceGen.UnitTests.csproj -c Release
env -u DOTNET_MODIFIABLE_ASSEMBLIES dotnet test src/Controls/tests/SourceGen.UnitTests/SourceGen.UnitTests.csproj -c Debug
  • SourceGen.UnitTests Debug: 497 passed / 18 skipped / 0 failed (515 total).
  • SourceGen.UnitTests Release: 497 passed / 18 skipped / 0 failed (515 total).
  • XamlIncrementalHotReloadE2ETests: 13 passed / 0 skipped / 0 failed.
  • HotReload.AiAssisted: 41 passed / 18 skipped / 0 failed.
  • Default Debug with metadata updates explicitly unavailable: 475 passed / 37 skipped / 0 failed (512 total). xUnit reports each skip-gated theory once rather than once per data row.

Redth and others added 5 commits July 22, 2026 10:55
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 1b9bf3f3-3e24-49bf-b3eb-c075858ee563
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 8dc5778b-13c3-40aa-8b21-76617ea71b69
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 8dc5778b-13c3-40aa-8b21-76617ea71b69
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 8dc5778b-13c3-40aa-8b21-76617ea71b69
@Redth
Redth temporarily deployed to copilot-pat-pool July 22, 2026 16:34 — with GitHub Actions Inactive
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 36730

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 36730"

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

@Redth
Redth temporarily deployed to copilot-pat-pool July 22, 2026 16:35 — with GitHub Actions Inactive
@Redth
Redth temporarily deployed to copilot-pat-pool July 22, 2026 16:36 — with GitHub Actions Inactive
@Redth Redth changed the title Improve incremental XAML hot reload generation and coverage XAML Hot Reload: Improve incremental generation and coverage Jul 22, 2026
@Redth
Redth temporarily deployed to copilot-pat-pool July 22, 2026 16:38 — with GitHub Actions Inactive
@Redth
Redth temporarily deployed to copilot-pat-pool July 22, 2026 16:39 — with GitHub Actions Inactive
@github-actions github-actions Bot added the area-tooling XAML & C# Hot Reload, XAML Editor, Live Visual Tree, Live Preview, Debugging label Jul 22, 2026
@Redth
Redth temporarily deployed to copilot-pat-pool July 22, 2026 16:39 — with GitHub Actions Inactive
Redth and others added 14 commits July 22, 2026 14:52
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 8dc5778b-13c3-40aa-8b21-76617ea71b69
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f093ec6b-e912-40c6-acae-f308f79ee558
Adds ResourceAndThemeHotReloadTests.cs covering DynamicResource key
rename/reversal (RT-01, live GREEN across Color/Double/String),
merged-dictionary and BasedOn/trigger-style complex-property skip
markers (RT-02/04/06, live GREEN guards), and their corresponding
honest skip-gated RED probes (RT-03/05/07) tracked by #36732 for
collection/property reconciliation gaps.

Empirically corrected 3 XAML shapes relative to the literal contract
assumption, verified against real generator output:
- RT-02/03: root ContentPage.Resources with an explicit
  <ResourceDictionary><ResourceDictionary.MergedDictionaries>> wrapper
  is silently dropped by TryEmitResourceDictionaryChange (unkeyed
  ElementNode, no marker). Moved MergedDictionaries under a non-root
  element's Resources (VerticalStackLayout.Resources) to correctly hit
  the generic "Complex property 'Resources' ... skipped" marker.
- RT-04/05: keyed Style resources wrapped in an explicit
  <ResourceDictionary> tag also hit the silent unkeyed-node bailout.
  Removed the wrapper so XAML's implicit dictionary conversion emits a
  keyed ListNode, producing the expected per-key
  "Cannot encode resource '...' — left untouched" markers.
- RT-06/07: removing Label.Style entirely hits the "Style cleared"
  ClearValue path, not the complex-property marker. Changed V2 to a
  different-but-still-present inline Style so the change is detected
  as a complex-property replacement instead of a removal.

Scope: new test file only; no README, harness, or product code
changes.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 8191a632-a704-4949-865b-a38bd8133f6d
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 96ebbad1-0079-4d43-a464-bb0b9ebadd89
…1..06)

Add TemplateAndSelectorHotReloadTests covering DataTemplate/ControlTemplate/
DataTemplateSelector behavior under XAML Incremental Hot Reload (PR #36730).

Empirically, editing a keyed template resource makes UpdateComponent replace the
entry with a factory-less `new DataTemplate()`, and a held template keeps its
construction-time factory delegate (not EnC-refreshed). So future
CreateContent()/SelectTemplate() does NOT reflect the edit. Per the robustness
rule the "future realization uses the new factory" claim is reclassified (not
weakened) into skip-gated RED-PROBEs; each family keeps a faithful GREEN anchor.

- TS-01/02/03/04 GREEN anchors: construction realization correctness
  (per-realization namescope isolation, selector branch selection, compiled
  binding, x:Reference, VSM TargetName isolation), already-realized-subtree
  stability across an update, and generated-source oracles (new factory in
  InitializeComponent; exact resource-replacement marker in UpdateComponent).
- TS-01/02/03/04 RED-PROBEs: future realization reflects the edit — skip-gated
  on #36482.
- TS-05 GREEN guard: BindableLayout.ItemTemplate emits the attached-complex skip
  marker and still compiles.
- TS-06 RED-PROBE: BindableLayout retype/reverse controller children — skip-gated
  on #36732; green anchor is TS-05.

Verified with DOTNET_MODIFIABLE_ASSEMBLIES=debug: 6 passed, 5 skipped.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: d5e424fa-b2af-4909-9a4d-3b2114ac147d
Adds src/Controls/tests/SourceGen.UnitTests/HotReload/AiAssisted/NestedControlHotReloadTests.cs
covering same-compilation nested custom controls (generic ProbeCard fixtures) per the
Wave-2 final test plan sections 3.5/7/8/10:

- NC-01 (GREEN): NestedCustomControls_Construct_HaveIndependentIdentityAndNamescope -
  two ProbeCard instances construct with independent identity, namescope, per-instance
  local Resources, and correct per-card x:Reference resolution; mutating one card never
  bleeds into the other.
- NC-02 (DOC-SKIP-GUARD): NestedLocalResources_CustomConverter_EmitsSkipMarker - asserts
  the writer's non-root complex-property skip marker for a nested ProbeCard.Resources
  converter edit. Empirically verified the actually-reached site is
  UpdateComponentCodeWriter.cs:1194 (EmitPropertyChange, isRoot: false), not the plan's
  cited L929 (TryEmitResourceDictionaryChange), which is root-only (single caller:
  EmitRootPropertyChange).
- NC-03 (RED-PROBE, Skip-gated): NestedControls_LocalResources_XReference_RebindIndependently -
  3-version (V1/V2/V1) live probe referencing #36732: the nested-Resources skip means a
  converter-type swap never applies, while the sibling Value mutation still applies and
  re-invokes the ORIGINAL converter - asserted via per-card label text and static
  invocation counters (no invocation multiplication, no cross-card bleed, new converter
  never invoked). Skip-gated per plan's STOP RULE; paired DOC-SKIP-GUARD (NC-02) stays
  green.

Includes test-local workarounds (scoped to this file only, no harness/product edits):
a minimal synchronous IDispatcher/IDispatcherProvider stub (live Binding/PropertyChanged
paths require a registered dispatcher, which no prior hot-reload test exercised), and
manually-declared private fields on the PageStub for x:Name'd elements (the harness only
wires the InitializeComponent/UpdateComponent generator, not the separate code-behind
field-declaration generator that normally supplies these).

Validated: dotnet test --filter FullyQualifiedName~HotReload.AiAssisted.NestedControlHotReloadTests
under DOTNET_MODIFIABLE_ASSEMBLIES=debug - 2 passed, 1 skipped, 0 failed. dotnet format
--verify-no-changes clean on this file.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: ba10e73c-e9b1-46c7-8bf6-c7cd0a2fa15c
Verified NC-03's faithfulness before deciding whether to keep it
Skip-gated: the generated V2 UpdateComponent retrieves each ProbeCard
via XamlComponentRegistry.TryGet (never `new ProbeCard(...)`) in the
exact same diff block that emits the nested-Resources skip comment,
confirming the test reaches the intended retained nested-resource +
x:Reference rebind path rather than passing because a subtree/root
was replaced.

Strengthened the test itself to assert this permanently:
- Added an inline check on generation[1].UpdateComponentSource for
  both the TryGet-based lookup and the Resources skip marker, plus a
  negative check that no ProbeCard is reconstructed.
- Added explicit ReferenceEquals identity guards for page, both
  ProbeCard instances, and both Labels after each ApplyUpdate (V2 and
  V3), proving nothing is reconstructed across V1->V2->V1.
- Added ReferenceEquals guards on each card's resolved converter
  instance after each update, proving left/right local-resource
  independence holds throughout, not just at construction.

All invariants hold empirically (visible prefixes genuinely change
A1/B1->A2/B2->A1/B1, invocation counts increase by exactly 2 per
version with no multiplication, no cross-card bleed) with no
incorrect/multiplied/cross-bled behavior, so this is a well-defined,
side-effect-free fallback rather than a red probe. Promoted from
[MetadataUpdateFact(Skip = ...)] to [MetadataUpdateFact], updated the
provenance header to "Expected: GREEN", and removed the #36732
skip-rationale linkage (NC-02 keeps its own, unrelated Issue
reference for the underlying writer-roadmap gap).

Targeted class run: 3 passed, 0 skipped, 0 failed.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: ba10e73c-e9b1-46c7-8bf6-c7cd0a2fa15c
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 8dc5778b-13c3-40aa-8b21-76617ea71b69
Implements faithful Phase-2 coverage in ResourceAndThemeHotReloadTests,
building on the integrated Phase-0/1 harness (app host, theme flip,
multi-instance, multi-document).

- RT-08 AppThemeBinding branch edit/reverse: split into a GREEN
  generation-atomic anchor (branch literal Light1->Light2->Light1 captured
  in the generated component, Dark untouched, all versions compile) plus a
  Skip-gated live RED-PROBE. The live re-provide is unsupported because the
  generated UpdateComponent re-provides the AppThemeBinding through an
  IProvideValueTarget whose TargetProperty is null, so
  AppThemeBindingExtension.ProvideValue throws "Cannot determine property to
  provide the value for" (tracked by #36732).
- RT-09 application-scope DynamicResource fanout (GREEN): two retained roots
  update once each plus a fresh post-update root starts latest, via app-scoped
  key swap (AccentA/AccentB) under a live Application host; app dictionary
  identity asserted stable.
- RT-10 Source= merged dictionary reorder/removal: GREEN generator/compile
  anchor tracking document reorder+removal and recompiling every version, plus
  a Skip-gated live RED-PROBE documenting the Source= resource-payload harness
  boundary (no faked ResourceLoader; tracked by #36732).
- RT-11 multi-document malformed->repair atomicity (GREEN, generator-atomic):
  a malformed page in a two-AdditionalText batch surfaces a parser error and
  does not phantom-advance to a compilable page; the repaired version fully
  recovers and compiles, with the sibling dictionary tracked throughout.
  Labeled generator-atomic (not live-resource atomic) because Source= cannot
  wire the dictionary in this harness (same boundary as RT-10).

Empirically run with DOTNET_MODIFIABLE_ASSEMBLIES=debug: the class is green
(10 passed, 5 skipped, 0 failed); the two new skips are documented live
RED-PROBEs with real bodies, never empty always-skipped tests.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 3954ca4a-026e-46b1-a878-8ed0ba5224be
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 3aecbe3b-4302-428f-a397-9f0923d19656
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 60c67cff-beec-4a4b-848d-fafbe39b837b
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 60c67cff-beec-4a4b-848d-fafbe39b837b
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 1b9bf3f3-3e24-49bf-b3eb-c075858ee563
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 1b9bf3f3-3e24-49bf-b3eb-c075858ee563
Comment thread src/Controls/tests/SourceGen.UnitTests/HotReload/AiAssisted/README.md Outdated
Comment thread src/Controls/src/SourceGen/SourceGenContext.cs Outdated
Comment thread src/Controls/tests/SourceGen.UnitTests/MetadataUpdateFactAttribute.cs Outdated
@MauiBot MauiBot added s/agent-changes-requested AI agent recommends changes - found a better alternative or issues s/agent-fix-pr-picked AI could not beat the PR fix - PR is the best among all candidates s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review) labels Jul 26, 2026
@MauiBot

MauiBot commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator

AI Review Summary

@Redth — new AI review results are available based on this last commit: 523ee85.

Gate Inconclusive Confidence Low Platform Windows


🗂️ Review Sessions — click to expand
🚦 Gate — Test Before & After Fix

Gate Result: ⚠️ INCONCLUSIVE

Platform: WINDOWS · Base: net11.0 · Merge base: bbcba3ff

🩺 Base branch does not compile — the without-fix build failed. The gate's "does the test fail without the fix" check is unreliable here; this usually means main is broken or a merge-base file went missing. Investigate before trusting this gate.

D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(15,34): error CS1501: No overload for method 'CreateNewForTests' takes 1 arguments [D:\a\1\s\src\Controls\tests\SourceGen.UnitT...

Test Without Fix (expect FAIL) With Fix (expect PASS)
🧪 BindingAndMarkupHotReloadTests BindingAndMarkupHotReloadTests 🛠️ BUILD ERROR ✅ PASS — 42s
🧪 CrossAssemblyHotReloadTests CrossAssemblyHotReloadTests 🛠️ BUILD ERROR ✅ PASS — 32s
🧪 GeneratorRecoveryHotReloadTests GeneratorRecoveryHotReloadTests 🛠️ BUILD ERROR ✅ PASS — 31s
🧪 HarnessCapabilityTests HarnessCapabilityTests 🛠️ BUILD ERROR ✅ PASS — 31s
🧪 NestedControlHotReloadTests NestedControlHotReloadTests 🛠️ BUILD ERROR ✅ PASS — 30s
🧪 ResourceAndThemeHotReloadTests ResourceAndThemeHotReloadTests 🛠️ BUILD ERROR ✅ PASS — 33s
🧪 SourceGenContextTests SourceGenContextTests 🛠️ BUILD ERROR ✅ PASS — 27s
🧪 StructuralHotReloadTests StructuralHotReloadTests 🛠️ BUILD ERROR ✅ PASS — 31s
🧪 TemplateAndSelectorHotReloadTests TemplateAndSelectorHotReloadTests 🛠️ BUILD ERROR ✅ PASS — 30s
🧪 VisualStateHotReloadTests VisualStateHotReloadTests 🛠️ BUILD ERROR ✅ PASS — 30s
🧪 XamlIncrementalHotReloadE2ETests XamlIncrementalHotReloadE2ETests 🛠️ BUILD ERROR ✅ PASS — 31s
🔴 Without fix — 🧪 BindingAndMarkupHotReloadTests: 🛠️ BUILD ERROR · 181s

Error-relevant lines (filtered from the build log):

D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(15,34): error CS1501: No overload for method 'CreateNewForTests' takes 1 arguments [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(20,11): error CS1061: 'SourceGenContext' does not contain a definition for 'BeginDiagnosticBuffering' and no accessible extension method 'BeginDiagnosticBuffering' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(24,27): error CS1061: 'SourceGenContext' does not contain a definition for 'BufferedDiagnosticCount' and no accessible extension method 'BufferedDiagnosticCount' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(26,11): error CS1061: 'SourceGenContext' does not contain a definition for 'DiscardBufferedDiagnostics' and no accessible extension method 'DiscardBufferedDiagnostics' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(28,27): error CS1061: 'SourceGenContext' does not contain a definition for 'BufferedDiagnosticCount' and no accessible extension method 'BufferedDiagnosticCount' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(31,11): error CS1061: 'SourceGenContext' does not contain a definition for 'BeginDiagnosticBuffering' and no accessible extension method 'BeginDiagnosticBuffering' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(33,11): error CS1061: 'SourceGenContext' does not contain a definition for 'FlushBufferedDiagnostics' and no accessible extension method 'FlushBufferedDiagnostics' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(36,27): error CS1061: 'SourceGenContext' does not contain a definition for 'BufferedDiagnosticCount' and no accessible extension method 'BufferedDiagnosticCount' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
🟢 With fix — 🧪 BindingAndMarkupHotReloadTests: PASS ✅ · 42s

(no coded error found; showing last 1200 chars)


[xUnit.net 00:00:01.88]     Microsoft.Maui.Controls.SourceGen.UnitTests.HotReload.AiAssisted.BindingAndMarkupHotReloadTests.CustomMarkupExtension_EditAndReverse_ReprovidesValue [SKIP]
[xUnit.net 00:00:01.88]       Requires runtime support for applying metadata updates. Set DOTNET_MODIFIABLE_ASSEMBLIES=debug in the environment to run these tests.
[xUnit.net 00:00:01.88]   Finished:    Microsoft.Maui.Controls.SourceGen.UnitTests
  Passed Microsoft.Maui.Controls.SourceGen.UnitTests.HotReload.AiAssisted.BindingAndMarkupHotReloadTests.MultiBinding_ComplexProperty_EmitsSkipMarker [1 s]
  Skipped Microsoft.Maui.Controls.SourceGen.UnitTests.HotReload.AiAssisted.BindingAndMarkupHotReloadTests.DynamicResourceToBinding_RemovesDormantRegistration [1 ms]
  Skipped Microsoft.Maui.Controls.SourceGen.UnitTests.HotReload.AiAssisted.BindingAndMarkupHotReloadTests.DynamicResourceToBinding_SwapAndReverse_UpdatesVisibleValue [1 ms]
  Skipped Microsoft.Maui.Controls.SourceGen.UnitTests.HotReload.AiAssisted.BindingAndMarkupHotReloadTests.CustomMarkupExtension_EditAndReverse_ReprovidesValue [1 ms]

Test Run Successful.
Total tests: 5
     Passed: 1
    Skipped: 4
 Total time: 2.5243 Seconds

🔴 Without fix — 🧪 CrossAssemblyHotReloadTests: 🛠️ BUILD ERROR · 48s

Error-relevant lines (filtered from the build log):

D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(15,34): error CS1501: No overload for method 'CreateNewForTests' takes 1 arguments [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(20,11): error CS1061: 'SourceGenContext' does not contain a definition for 'BeginDiagnosticBuffering' and no accessible extension method 'BeginDiagnosticBuffering' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(24,27): error CS1061: 'SourceGenContext' does not contain a definition for 'BufferedDiagnosticCount' and no accessible extension method 'BufferedDiagnosticCount' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(26,11): error CS1061: 'SourceGenContext' does not contain a definition for 'DiscardBufferedDiagnostics' and no accessible extension method 'DiscardBufferedDiagnostics' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(28,27): error CS1061: 'SourceGenContext' does not contain a definition for 'BufferedDiagnosticCount' and no accessible extension method 'BufferedDiagnosticCount' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(31,11): error CS1061: 'SourceGenContext' does not contain a definition for 'BeginDiagnosticBuffering' and no accessible extension method 'BeginDiagnosticBuffering' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(33,11): error CS1061: 'SourceGenContext' does not contain a definition for 'FlushBufferedDiagnostics' and no accessible extension method 'FlushBufferedDiagnostics' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(36,27): error CS1061: 'SourceGenContext' does not contain a definition for 'BufferedDiagnosticCount' and no accessible extension method 'BufferedDiagnosticCount' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
🟢 With fix — 🧪 CrossAssemblyHotReloadTests: PASS ✅ · 32s

(no coded error found; showing last 1200 chars)

.Maui.Controls.SourceGen.dll
  SourceGen.UnitTests -> D:\a\1\s\artifacts\bin\SourceGen.UnitTests\Debug\net11.0\Microsoft.Maui.Controls.SourceGen.UnitTests.dll
Test run for D:\a\1\s\artifacts\bin\SourceGen.UnitTests\Debug\net11.0\Microsoft.Maui.Controls.SourceGen.UnitTests.dll (.NETCoreApp,Version=v11.0)
A total of 1 test files matched the specified pattern.
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 11.0.0-preview.7.26365.101)
[xUnit.net 00:00:00.13]   Discovering: Microsoft.Maui.Controls.SourceGen.UnitTests
[xUnit.net 00:00:00.28]   Discovered:  Microsoft.Maui.Controls.SourceGen.UnitTests
[xUnit.net 00:00:00.29]   Starting:    Microsoft.Maui.Controls.SourceGen.UnitTests
  Passed Microsoft.Maui.Controls.SourceGen.UnitTests.HotReload.AiAssisted.CrossAssemblyHotReloadTests.ReferencedAssemblySwap_InvalidatesXamlPipeline [2 s]
[xUnit.net 00:00:02.80]   Finished:    Microsoft.Maui.Controls.SourceGen.UnitTests
  Passed Microsoft.Maui.Controls.SourceGen.UnitTests.HotReload.AiAssisted.CrossAssemblyHotReloadTests.UnchangedReferences_XamlPipelineCached [59 ms]

Test Run Successful.
Total tests: 2
     Passed: 2
 Total time: 3.5477 Seconds

🔴 Without fix — 🧪 GeneratorRecoveryHotReloadTests: 🛠️ BUILD ERROR · 34s

Error-relevant lines (filtered from the build log):

D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(15,34): error CS1501: No overload for method 'CreateNewForTests' takes 1 arguments [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(20,11): error CS1061: 'SourceGenContext' does not contain a definition for 'BeginDiagnosticBuffering' and no accessible extension method 'BeginDiagnosticBuffering' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(24,27): error CS1061: 'SourceGenContext' does not contain a definition for 'BufferedDiagnosticCount' and no accessible extension method 'BufferedDiagnosticCount' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(26,11): error CS1061: 'SourceGenContext' does not contain a definition for 'DiscardBufferedDiagnostics' and no accessible extension method 'DiscardBufferedDiagnostics' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(28,27): error CS1061: 'SourceGenContext' does not contain a definition for 'BufferedDiagnosticCount' and no accessible extension method 'BufferedDiagnosticCount' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(31,11): error CS1061: 'SourceGenContext' does not contain a definition for 'BeginDiagnosticBuffering' and no accessible extension method 'BeginDiagnosticBuffering' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(33,11): error CS1061: 'SourceGenContext' does not contain a definition for 'FlushBufferedDiagnostics' and no accessible extension method 'FlushBufferedDiagnostics' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(36,27): error CS1061: 'SourceGenContext' does not contain a definition for 'BufferedDiagnosticCount' and no accessible extension method 'BufferedDiagnosticCount' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
🟢 With fix — 🧪 GeneratorRecoveryHotReloadTests: PASS ✅ · 31s

(no coded error found; showing last 1200 chars)

ildnumber]11.0.0-ci+azdo.14772101
  Controls.SourceGen -> D:\a\1\s\artifacts\bin\Controls.SourceGen\Debug\netstandard2.0\Microsoft.Maui.Controls.SourceGen.dll
  SourceGen.UnitTests -> D:\a\1\s\artifacts\bin\SourceGen.UnitTests\Debug\net11.0\Microsoft.Maui.Controls.SourceGen.UnitTests.dll
Test run for D:\a\1\s\artifacts\bin\SourceGen.UnitTests\Debug\net11.0\Microsoft.Maui.Controls.SourceGen.UnitTests.dll (.NETCoreApp,Version=v11.0)
A total of 1 test files matched the specified pattern.
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 11.0.0-preview.7.26365.101)
[xUnit.net 00:00:00.13]   Discovering: Microsoft.Maui.Controls.SourceGen.UnitTests
[xUnit.net 00:00:00.28]   Discovered:  Microsoft.Maui.Controls.SourceGen.UnitTests
[xUnit.net 00:00:00.29]   Starting:    Microsoft.Maui.Controls.SourceGen.UnitTests
[xUnit.net 00:00:03.42]   Finished:    Microsoft.Maui.Controls.SourceGen.UnitTests
  Passed Microsoft.Maui.Controls.SourceGen.UnitTests.HotReload.AiAssisted.GeneratorRecoveryHotReloadTests.MalformedExpression_ThenRepair_RecomputesGeneratorDiagnostics [3 s]

Test Run Successful.
Total tests: 1
     Passed: 1
 Total time: 4.2117 Seconds

🔴 Without fix — 🧪 HarnessCapabilityTests: 🛠️ BUILD ERROR · 31s

Error-relevant lines (filtered from the build log):

D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(15,34): error CS1501: No overload for method 'CreateNewForTests' takes 1 arguments [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(20,11): error CS1061: 'SourceGenContext' does not contain a definition for 'BeginDiagnosticBuffering' and no accessible extension method 'BeginDiagnosticBuffering' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(24,27): error CS1061: 'SourceGenContext' does not contain a definition for 'BufferedDiagnosticCount' and no accessible extension method 'BufferedDiagnosticCount' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(26,11): error CS1061: 'SourceGenContext' does not contain a definition for 'DiscardBufferedDiagnostics' and no accessible extension method 'DiscardBufferedDiagnostics' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(28,27): error CS1061: 'SourceGenContext' does not contain a definition for 'BufferedDiagnosticCount' and no accessible extension method 'BufferedDiagnosticCount' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(31,11): error CS1061: 'SourceGenContext' does not contain a definition for 'BeginDiagnosticBuffering' and no accessible extension method 'BeginDiagnosticBuffering' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(33,11): error CS1061: 'SourceGenContext' does not contain a definition for 'FlushBufferedDiagnostics' and no accessible extension method 'FlushBufferedDiagnostics' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(36,27): error CS1061: 'SourceGenContext' does not contain a definition for 'BufferedDiagnosticCount' and no accessible extension method 'BufferedDiagnosticCount' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
🟢 With fix — 🧪 HarnessCapabilityTests: PASS ✅ · 31s

(no coded error found; showing last 1200 chars)

ootStartsLatest [SKIP]
[xUnit.net 00:00:00.36]       Requires runtime support for applying metadata updates. Set DOTNET_MODIFIABLE_ASSEMBLIES=debug in the environment to run these tests.
  Skipped Microsoft.Maui.Controls.SourceGen.UnitTests.HotReload.AiAssisted.HarnessCapabilityTests.MultiDocument_DictionaryOnlyEdit_RetainsPageAndLabelIdentity [1 ms]
  Skipped Microsoft.Maui.Controls.SourceGen.UnitTests.HotReload.AiAssisted.HarnessCapabilityTests.ApplicationHost_ThemeFlipIsSynchronous [1 ms]
  Skipped Microsoft.Maui.Controls.SourceGen.UnitTests.HotReload.AiAssisted.HarnessCapabilityTests.MultipleInstances_RetainedRootsUpdateAndFreshRootStartsLatest [1 ms]
[xUnit.net 00:00:03.48]   Finished:    Microsoft.Maui.Controls.SourceGen.UnitTests
  Passed Microsoft.Maui.Controls.SourceGen.UnitTests.HotReload.AiAssisted.HarnessCapabilityTests.ApplicationHost_ResolvesAppResources_AndRestoresPreviousApplication [2 s]
  Passed Microsoft.Maui.Controls.SourceGen.UnitTests.HotReload.AiAssisted.HarnessCapabilityTests.MultiDocument_DictionaryOnlyEdit_TracksAllDocumentsAndCompilesPage [180 ms]

Test Run Successful.
Total tests: 5
     Passed: 2
    Skipped: 3
 Total time: 4.2360 Seconds

🔴 Without fix — 🧪 NestedControlHotReloadTests: 🛠️ BUILD ERROR · 30s

Error-relevant lines (filtered from the build log):

D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(15,34): error CS1501: No overload for method 'CreateNewForTests' takes 1 arguments [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(20,11): error CS1061: 'SourceGenContext' does not contain a definition for 'BeginDiagnosticBuffering' and no accessible extension method 'BeginDiagnosticBuffering' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(24,27): error CS1061: 'SourceGenContext' does not contain a definition for 'BufferedDiagnosticCount' and no accessible extension method 'BufferedDiagnosticCount' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(26,11): error CS1061: 'SourceGenContext' does not contain a definition for 'DiscardBufferedDiagnostics' and no accessible extension method 'DiscardBufferedDiagnostics' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(28,27): error CS1061: 'SourceGenContext' does not contain a definition for 'BufferedDiagnosticCount' and no accessible extension method 'BufferedDiagnosticCount' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(31,11): error CS1061: 'SourceGenContext' does not contain a definition for 'BeginDiagnosticBuffering' and no accessible extension method 'BeginDiagnosticBuffering' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(33,11): error CS1061: 'SourceGenContext' does not contain a definition for 'FlushBufferedDiagnostics' and no accessible extension method 'FlushBufferedDiagnostics' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(36,27): error CS1061: 'SourceGenContext' does not contain a definition for 'BufferedDiagnosticCount' and no accessible extension method 'BufferedDiagnosticCount' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
🟢 With fix — 🧪 NestedControlHotReloadTests: PASS ✅ · 30s

(no coded error found; showing last 1200 chars)

ces_XReference_RebindIndependently [1 ms]
[xUnit.net 00:00:04.07]     Microsoft.Maui.Controls.SourceGen.UnitTests.HotReload.AiAssisted.NestedControlHotReloadTests.NestedGeneratedRoots_LocalResources_XReference_RetainedInstancesAndFreshInstanceStayIndependent [SKIP]
[xUnit.net 00:00:04.07]       Issue #36732: generated root Resources updates remove registered keys but do not reconstruct the V2 dictionary, so retained x:Reference bindings keep the V1 converter.
[xUnit.net 00:00:04.08]   Finished:    Microsoft.Maui.Controls.SourceGen.UnitTests
  Passed Microsoft.Maui.Controls.SourceGen.UnitTests.HotReload.AiAssisted.NestedControlHotReloadTests.NestedLocalResources_CustomConverter_EmitsSkipMarker [3 s]
  Passed Microsoft.Maui.Controls.SourceGen.UnitTests.HotReload.AiAssisted.NestedControlHotReloadTests.NestedGeneratedRoots_LocalResources_EmitsDocumentedResourceDecline [252 ms]
  Skipped Microsoft.Maui.Controls.SourceGen.UnitTests.HotReload.AiAssisted.NestedControlHotReloadTests.NestedGeneratedRoots_LocalResources_XReference_RetainedInstancesAndFreshInstanceStayIndependent [1 ms]

Test Run Successful.
Total tests: 5
     Passed: 2
    Skipped: 3
 Total time: 4.8241 Seconds

🔴 Without fix — 🧪 ResourceAndThemeHotReloadTests: 🛠️ BUILD ERROR · 29s

Error-relevant lines (filtered from the build log):

D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(15,34): error CS1501: No overload for method 'CreateNewForTests' takes 1 arguments [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(20,11): error CS1061: 'SourceGenContext' does not contain a definition for 'BeginDiagnosticBuffering' and no accessible extension method 'BeginDiagnosticBuffering' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(24,27): error CS1061: 'SourceGenContext' does not contain a definition for 'BufferedDiagnosticCount' and no accessible extension method 'BufferedDiagnosticCount' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(26,11): error CS1061: 'SourceGenContext' does not contain a definition for 'DiscardBufferedDiagnostics' and no accessible extension method 'DiscardBufferedDiagnostics' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(28,27): error CS1061: 'SourceGenContext' does not contain a definition for 'BufferedDiagnosticCount' and no accessible extension method 'BufferedDiagnosticCount' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(31,11): error CS1061: 'SourceGenContext' does not contain a definition for 'BeginDiagnosticBuffering' and no accessible extension method 'BeginDiagnosticBuffering' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(33,11): error CS1061: 'SourceGenContext' does not contain a definition for 'FlushBufferedDiagnostics' and no accessible extension method 'FlushBufferedDiagnostics' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(36,27): error CS1061: 'SourceGenContext' does not contain a definition for 'BufferedDiagnosticCount' and no accessible extension method 'BufferedDiagnosticCount' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
🟢 With fix — 🧪 ResourceAndThemeHotReloadTests: PASS ✅ · 33s

(no coded error found; showing last 1200 chars)

ReloadTests.InlineMergedDictionaries_ReorderThenRemove_RecomputesWinner [1 ms]
  Skipped Microsoft.Maui.Controls.SourceGen.UnitTests.HotReload.AiAssisted.ResourceAndThemeHotReloadTests.ActiveTriggerStyle_RemoveReAdd_UnappliesBeforeReattach [1 ms]
[xUnit.net 00:00:03.84]     Microsoft.Maui.Controls.SourceGen.UnitTests.HotReload.AiAssisted.ResourceAndThemeHotReloadTests.SourceMergedDictionaries_ReorderThenRemove_UsesRuntimeFallback [SKIP]
[xUnit.net 00:00:03.84]       Blocked by the harness Source= resource-loader boundary: a ResourceDictionary loaded through Source= has no compiled resource payload in this in-memory generator/ALC harness, so the runtime cannot reload it into a retained page without faking ResourceLoader; green anchor: SourceMergedDictionaries_ReorderThenRemove_TracksDocumentsAndCompiles; tracked by #36732
[xUnit.net 00:00:03.85]   Finished:    Microsoft.Maui.Controls.SourceGen.UnitTests
  Skipped Microsoft.Maui.Controls.SourceGen.UnitTests.HotReload.AiAssisted.ResourceAndThemeHotReloadTests.SourceMergedDictionaries_ReorderThenRemove_UsesRuntimeFallback [1 ms]

Test Run Successful.
Total tests: 13
     Passed: 6
    Skipped: 7
 Total time: 4.5412 Seconds

🔴 Without fix — 🧪 SourceGenContextTests: 🛠️ BUILD ERROR · 27s

Error-relevant lines (filtered from the build log):

D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(15,34): error CS1501: No overload for method 'CreateNewForTests' takes 1 arguments [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(20,11): error CS1061: 'SourceGenContext' does not contain a definition for 'BeginDiagnosticBuffering' and no accessible extension method 'BeginDiagnosticBuffering' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(24,27): error CS1061: 'SourceGenContext' does not contain a definition for 'BufferedDiagnosticCount' and no accessible extension method 'BufferedDiagnosticCount' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(26,11): error CS1061: 'SourceGenContext' does not contain a definition for 'DiscardBufferedDiagnostics' and no accessible extension method 'DiscardBufferedDiagnostics' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(28,27): error CS1061: 'SourceGenContext' does not contain a definition for 'BufferedDiagnosticCount' and no accessible extension method 'BufferedDiagnosticCount' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(31,11): error CS1061: 'SourceGenContext' does not contain a definition for 'BeginDiagnosticBuffering' and no accessible extension method 'BeginDiagnosticBuffering' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(33,11): error CS1061: 'SourceGenContext' does not contain a definition for 'FlushBufferedDiagnostics' and no accessible extension method 'FlushBufferedDiagnostics' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(36,27): error CS1061: 'SourceGenContext' does not contain a definition for 'BufferedDiagnosticCount' and no accessible extension method 'BufferedDiagnosticCount' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
🟢 With fix — 🧪 SourceGenContextTests: PASS ✅ · 27s

(no coded error found; showing last 1200 chars)

i.Controls.Xaml.dll
  ##vso[build.updatebuildnumber]11.0.0-ci+azdo.14772101
  Controls.SourceGen -> D:\a\1\s\artifacts\bin\Controls.SourceGen\Debug\netstandard2.0\Microsoft.Maui.Controls.SourceGen.dll
  SourceGen.UnitTests -> D:\a\1\s\artifacts\bin\SourceGen.UnitTests\Debug\net11.0\Microsoft.Maui.Controls.SourceGen.UnitTests.dll
Test run for D:\a\1\s\artifacts\bin\SourceGen.UnitTests\Debug\net11.0\Microsoft.Maui.Controls.SourceGen.UnitTests.dll (.NETCoreApp,Version=v11.0)
A total of 1 test files matched the specified pattern.
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 11.0.0-preview.7.26365.101)
[xUnit.net 00:00:00.12]   Discovering: Microsoft.Maui.Controls.SourceGen.UnitTests
[xUnit.net 00:00:00.28]   Discovered:  Microsoft.Maui.Controls.SourceGen.UnitTests
[xUnit.net 00:00:00.29]   Starting:    Microsoft.Maui.Controls.SourceGen.UnitTests
[xUnit.net 00:00:00.41]   Finished:    Microsoft.Maui.Controls.SourceGen.UnitTests
  Passed Microsoft.Maui.Controls.SourceGen.UnitTests.SourceGenContextTests.BufferedDiagnostics_AreForwardedOnlyWhenFlushed [35 ms]

Test Run Successful.
Total tests: 1
     Passed: 1
 Total time: 1.1598 Seconds

🔴 Without fix — 🧪 StructuralHotReloadTests: 🛠️ BUILD ERROR · 28s

Error-relevant lines (filtered from the build log):

D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(15,34): error CS1501: No overload for method 'CreateNewForTests' takes 1 arguments [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(20,11): error CS1061: 'SourceGenContext' does not contain a definition for 'BeginDiagnosticBuffering' and no accessible extension method 'BeginDiagnosticBuffering' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(24,27): error CS1061: 'SourceGenContext' does not contain a definition for 'BufferedDiagnosticCount' and no accessible extension method 'BufferedDiagnosticCount' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(26,11): error CS1061: 'SourceGenContext' does not contain a definition for 'DiscardBufferedDiagnostics' and no accessible extension method 'DiscardBufferedDiagnostics' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(28,27): error CS1061: 'SourceGenContext' does not contain a definition for 'BufferedDiagnosticCount' and no accessible extension method 'BufferedDiagnosticCount' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(31,11): error CS1061: 'SourceGenContext' does not contain a definition for 'BeginDiagnosticBuffering' and no accessible extension method 'BeginDiagnosticBuffering' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(33,11): error CS1061: 'SourceGenContext' does not contain a definition for 'FlushBufferedDiagnostics' and no accessible extension method 'FlushBufferedDiagnostics' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(36,27): error CS1061: 'SourceGenContext' does not contain a definition for 'BufferedDiagnosticCount' and no accessible extension method 'BufferedDiagnosticCount' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
🟢 With fix — 🧪 StructuralHotReloadTests: PASS ✅ · 31s

(no coded error found; showing last 1200 chars)

nding Converter={StaticResource T"···) [3 s]
  Passed Microsoft.Maui.Controls.SourceGen.UnitTests.HotReload.AiAssisted.StructuralHotReloadTests.ComplexPropertyWithNestedStaticResourceShape_IsExplicitlySkipped(templateContent: "<Label>\r\n  <Label.BindingContext>\r\n    <Static"···) [69 ms]
  Passed Microsoft.Maui.Controls.SourceGen.UnitTests.HotReload.AiAssisted.StructuralHotReloadTests.ComplexPropertyWithNestedResources_IsExplicitlySkipped [142 ms]
  Passed Microsoft.Maui.Controls.SourceGen.UnitTests.HotReload.AiAssisted.StructuralHotReloadTests.StaticResourcePreflight_DiscardsParserDiagnostics [138 ms]
  Skipped Microsoft.Maui.Controls.SourceGen.UnitTests.HotReload.AiAssisted.StructuralHotReloadTests.RootComplexElementProperty_AppliesToExistingPage [1 ms]
  Passed Microsoft.Maui.Controls.SourceGen.UnitTests.HotReload.AiAssisted.StructuralHotReloadTests.ComplexPropertyWithAncestorStaticResource_IsExplicitlySkipped [84 ms]
  Passed Microsoft.Maui.Controls.SourceGen.UnitTests.HotReload.AiAssisted.StructuralHotReloadTests.RootComplexElementProperty_IsNotSilentlyDropped [58 ms]

Test Run Successful.
Total tests: 7
     Passed: 6
    Skipped: 1
 Total time: 4.6358 Seconds

🔴 Without fix — 🧪 TemplateAndSelectorHotReloadTests: 🛠️ BUILD ERROR · 29s

Error-relevant lines (filtered from the build log):

D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(15,34): error CS1501: No overload for method 'CreateNewForTests' takes 1 arguments [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(20,11): error CS1061: 'SourceGenContext' does not contain a definition for 'BeginDiagnosticBuffering' and no accessible extension method 'BeginDiagnosticBuffering' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(24,27): error CS1061: 'SourceGenContext' does not contain a definition for 'BufferedDiagnosticCount' and no accessible extension method 'BufferedDiagnosticCount' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(26,11): error CS1061: 'SourceGenContext' does not contain a definition for 'DiscardBufferedDiagnostics' and no accessible extension method 'DiscardBufferedDiagnostics' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(28,27): error CS1061: 'SourceGenContext' does not contain a definition for 'BufferedDiagnosticCount' and no accessible extension method 'BufferedDiagnosticCount' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(31,11): error CS1061: 'SourceGenContext' does not contain a definition for 'BeginDiagnosticBuffering' and no accessible extension method 'BeginDiagnosticBuffering' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(33,11): error CS1061: 'SourceGenContext' does not contain a definition for 'FlushBufferedDiagnostics' and no accessible extension method 'FlushBufferedDiagnostics' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(36,27): error CS1061: 'SourceGenContext' does not contain a definition for 'BufferedDiagnosticCount' and no accessible extension method 'BufferedDiagnosticCount' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
🟢 With fix — 🧪 TemplateAndSelectorHotReloadTests: PASS ✅ · 30s

(no coded error found; showing last 1200 chars)

Complex_EmitsSkipMarker [2 s]
  Skipped Microsoft.Maui.Controls.SourceGen.UnitTests.HotReload.AiAssisted.TemplateAndSelectorHotReloadTests.ControlTemplate_Construction_NamescopeXReferenceAndVsmAreIsolated [1 ms]
  Skipped Microsoft.Maui.Controls.SourceGen.UnitTests.HotReload.AiAssisted.TemplateAndSelectorHotReloadTests.Selector_ConstructionDistinguishesBranchesAndIsStableAcrossUpdate [1 ms]
  Skipped Microsoft.Maui.Controls.SourceGen.UnitTests.HotReload.AiAssisted.TemplateAndSelectorHotReloadTests.CompiledTemplate_Retype_FutureRealizationBindsNewType [1 ms]
  Skipped Microsoft.Maui.Controls.SourceGen.UnitTests.HotReload.AiAssisted.TemplateAndSelectorHotReloadTests.KeyedDataTemplate_EditBody_ConstructionStableAndSourceReflectsEdit [1 ms]
  Skipped Microsoft.Maui.Controls.SourceGen.UnitTests.HotReload.AiAssisted.TemplateAndSelectorHotReloadTests.Selector_FutureRealizationReflectsNewFactory [1 ms]
  Skipped Microsoft.Maui.Controls.SourceGen.UnitTests.HotReload.AiAssisted.TemplateAndSelectorHotReloadTests.CompiledTemplate_RetypeAndReverse_GeneratedSourceTracksCurrentType [1 ms]

Test Run Successful.
Total tests: 10
     Passed: 1
    Skipped: 9
 Total time: 3.8815 Seconds

🔴 Without fix — 🧪 VisualStateHotReloadTests: 🛠️ BUILD ERROR · 28s

Error-relevant lines (filtered from the build log):

D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(15,34): error CS1501: No overload for method 'CreateNewForTests' takes 1 arguments [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(20,11): error CS1061: 'SourceGenContext' does not contain a definition for 'BeginDiagnosticBuffering' and no accessible extension method 'BeginDiagnosticBuffering' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(24,27): error CS1061: 'SourceGenContext' does not contain a definition for 'BufferedDiagnosticCount' and no accessible extension method 'BufferedDiagnosticCount' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(26,11): error CS1061: 'SourceGenContext' does not contain a definition for 'DiscardBufferedDiagnostics' and no accessible extension method 'DiscardBufferedDiagnostics' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(28,27): error CS1061: 'SourceGenContext' does not contain a definition for 'BufferedDiagnosticCount' and no accessible extension method 'BufferedDiagnosticCount' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(31,11): error CS1061: 'SourceGenContext' does not contain a definition for 'BeginDiagnosticBuffering' and no accessible extension method 'BeginDiagnosticBuffering' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(33,11): error CS1061: 'SourceGenContext' does not contain a definition for 'FlushBufferedDiagnostics' and no accessible extension method 'FlushBufferedDiagnostics' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(36,27): error CS1061: 'SourceGenContext' does not contain a definition for 'BufferedDiagnosticCount' and no accessible extension method 'BufferedDiagnosticCount' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
🟢 With fix — 🧪 VisualStateHotReloadTests: PASS ✅ · 30s

(no coded error found; showing last 1200 chars)

iAssisted.VisualStateHotReloadTests.ActiveVsmSetter_ComplexAttachedProperty_EmitsSkipMarker [74 ms]
  Passed Microsoft.Maui.Controls.SourceGen.UnitTests.HotReload.AiAssisted.VisualStateHotReloadTests.VsmState_AddRemoveReAdd_ComplexAttachedProperty_EmitsSkipMarker [221 ms]
  Skipped Microsoft.Maui.Controls.SourceGen.UnitTests.HotReload.AiAssisted.VisualStateHotReloadTests.BehaviorCollection_RemoveReAdd_DetachesAndAttachesOnce [1 ms]
  Passed Microsoft.Maui.Controls.SourceGen.UnitTests.HotReload.AiAssisted.VisualStateHotReloadTests.Behavior_ClearAndComplexProperty_EmitsSkipMarker [267 ms]
  Skipped Microsoft.Maui.Controls.SourceGen.UnitTests.HotReload.AiAssisted.VisualStateHotReloadTests.ActiveVsmThemeResourceSetter_EditAndReverse_PreservesStateAndThemeSemantics [1 ms]
  Skipped Microsoft.Maui.Controls.SourceGen.UnitTests.HotReload.AiAssisted.VisualStateHotReloadTests.VsmState_AddRemoveReAdd_And_FallbackReversion [1 ms]
  Skipped Microsoft.Maui.Controls.SourceGen.UnitTests.HotReload.AiAssisted.VisualStateHotReloadTests.ActiveVsmSetter_EditAndReverse_ReappliesImmediately [1 ms]

Test Run Successful.
Total tests: 8
     Passed: 4
    Skipped: 4
 Total time: 4.5872 Seconds

🔴 Without fix — 🧪 XamlIncrementalHotReloadE2ETests: 🛠️ BUILD ERROR · 29s

Error-relevant lines (filtered from the build log):

D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(15,34): error CS1501: No overload for method 'CreateNewForTests' takes 1 arguments [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(20,11): error CS1061: 'SourceGenContext' does not contain a definition for 'BeginDiagnosticBuffering' and no accessible extension method 'BeginDiagnosticBuffering' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(24,27): error CS1061: 'SourceGenContext' does not contain a definition for 'BufferedDiagnosticCount' and no accessible extension method 'BufferedDiagnosticCount' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(26,11): error CS1061: 'SourceGenContext' does not contain a definition for 'DiscardBufferedDiagnostics' and no accessible extension method 'DiscardBufferedDiagnostics' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(28,27): error CS1061: 'SourceGenContext' does not contain a definition for 'BufferedDiagnosticCount' and no accessible extension method 'BufferedDiagnosticCount' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(31,11): error CS1061: 'SourceGenContext' does not contain a definition for 'BeginDiagnosticBuffering' and no accessible extension method 'BeginDiagnosticBuffering' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(33,11): error CS1061: 'SourceGenContext' does not contain a definition for 'FlushBufferedDiagnostics' and no accessible extension method 'FlushBufferedDiagnostics' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(36,27): error CS1061: 'SourceGenContext' does not contain a definition for 'BufferedDiagnosticCount' and no accessible extension method 'BufferedDiagnosticCount' accepting a first argument of type 'SourceGenContext' could be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj]
🟢 With fix — 🧪 XamlIncrementalHotReloadE2ETests: PASS ✅ · 31s

(no coded error found; showing last 1200 chars)

xUnit.net 00:00:03.73]       Requires runtime support for applying metadata updates. Set DOTNET_MODIFIABLE_ASSEMBLIES=debug in the environment to run these tests.
[xUnit.net 00:00:03.73]     Microsoft.Maui.Controls.SourceGen.UnitTests.XamlIncrementalHotReloadE2ETests.SuccessiveUpdates_AppliedToSameLiveInstance [SKIP]
[xUnit.net 00:00:03.73]       Requires runtime support for applying metadata updates. Set DOTNET_MODIFIABLE_ASSEMBLIES=debug in the environment to run these tests.
[xUnit.net 00:00:03.80]   Finished:    Microsoft.Maui.Controls.SourceGen.UnitTests
  Passed Microsoft.Maui.Controls.SourceGen.UnitTests.XamlIncrementalHotReloadE2ETests.RootContentReplaced_CompilesCleanly [93 ms]
  Skipped Microsoft.Maui.Controls.SourceGen.UnitTests.XamlIncrementalHotReloadE2ETests.ResourceRemoved_AppliedViaHotReload [1 ms]
  Skipped Microsoft.Maui.Controls.SourceGen.UnitTests.XamlIncrementalHotReloadE2ETests.SuccessiveUpdates_AppliedToSameLiveInstance [1 ms]
  Passed Microsoft.Maui.Controls.SourceGen.UnitTests.XamlIncrementalHotReloadE2ETests.ResourceRemoved_CompilesCleanly [58 ms]

Test Run Successful.
Total tests: 13
     Passed: 7
    Skipped: 6
 Total time: 4.5754 Seconds

⚠️ Failure Details (11 tests)
  • 🛠️ BindingAndMarkupHotReloadTests without fix: build failed before tests could run
    • D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(15,34): error CS1501: No overload for method 'CreateNewForTests' takes 1 arguments [D:\a\1\s\src\Controls\tests\SourceGen.UnitT...
  • 🛠️ CrossAssemblyHotReloadTests without fix: build failed before tests could run
    • D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(15,34): error CS1501: No overload for method 'CreateNewForTests' takes 1 arguments [D:\a\1\s\src\Controls\tests\SourceGen.UnitT...
  • 🛠️ GeneratorRecoveryHotReloadTests without fix: build failed before tests could run
    • D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(15,34): error CS1501: No overload for method 'CreateNewForTests' takes 1 arguments [D:\a\1\s\src\Controls\tests\SourceGen.UnitT...
  • 🛠️ HarnessCapabilityTests without fix: build failed before tests could run
    • D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(15,34): error CS1501: No overload for method 'CreateNewForTests' takes 1 arguments [D:\a\1\s\src\Controls\tests\SourceGen.UnitT...
  • 🛠️ NestedControlHotReloadTests without fix: build failed before tests could run
    • D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(15,34): error CS1501: No overload for method 'CreateNewForTests' takes 1 arguments [D:\a\1\s\src\Controls\tests\SourceGen.UnitT...
  • 🛠️ ResourceAndThemeHotReloadTests without fix: build failed before tests could run
    • D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(15,34): error CS1501: No overload for method 'CreateNewForTests' takes 1 arguments [D:\a\1\s\src\Controls\tests\SourceGen.UnitT...
  • 🛠️ SourceGenContextTests without fix: build failed before tests could run
    • D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(15,34): error CS1501: No overload for method 'CreateNewForTests' takes 1 arguments [D:\a\1\s\src\Controls\tests\SourceGen.UnitT...
  • 🛠️ StructuralHotReloadTests without fix: build failed before tests could run
    • D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(15,34): error CS1501: No overload for method 'CreateNewForTests' takes 1 arguments [D:\a\1\s\src\Controls\tests\SourceGen.UnitT...
  • 🛠️ TemplateAndSelectorHotReloadTests without fix: build failed before tests could run
    • D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(15,34): error CS1501: No overload for method 'CreateNewForTests' takes 1 arguments [D:\a\1\s\src\Controls\tests\SourceGen.UnitT...
  • 🛠️ VisualStateHotReloadTests without fix: build failed before tests could run
    • D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(15,34): error CS1501: No overload for method 'CreateNewForTests' takes 1 arguments [D:\a\1\s\src\Controls\tests\SourceGen.UnitT...
  • 🛠️ XamlIncrementalHotReloadE2ETests without fix: build failed before tests could run
    • D:\a\1\s\src\Controls\tests\SourceGen.UnitTests\SourceGenContextTests.cs(15,34): error CS1501: No overload for method 'CreateNewForTests' takes 1 arguments [D:\a\1\s\src\Controls\tests\SourceGen.UnitT...
📁 Fix files reverted (2 files)
  • src/Controls/src/SourceGen/SourceGenContext.cs
  • src/Controls/src/SourceGen/UpdateComponentCodeWriter.cs

📱 UI Tests — Button,Label,Layout

Detected UI test categories: Button,Label,Layout

Deep UI tests — 344 passed, 0 failed across 3 categories on platform-pool agent (replaces in-process counts above).

🧪 UI Test Execution Results (deep, platform pool)

Category Tests Snapshot diffs
Button 69/70 ✓
Label 91/94 ✓
Layout 184/188 ✓
📎 Download drop-deep-uitests artifact (TRX + snapshot diffs)

📋 Pre-Flight — Context & Validation

Issue: #36256 - Incremental XAML Hot Reload (.uc.xsg.cs) generates invalid this.Content = (IView)... causing CS0266 (and surfaces as empty ENC1002)
PR: #36730 - XAML Hot Reload: Improve incremental generation and coverage
Platforms Affected: windows test platform; SourceGen/XAML Hot Reload behavior is cross-platform generator code
Files Changed: 2 implementation, 30 test/harness/docs

Key Findings

  • The PR targets the SourceGen incremental XAML Hot Reload writer for root-content replacement and newly-created element complex properties such as CollectionView.ItemTemplate.
  • The PR's production approach reuses the InitializeComponent visitor pipeline speculatively for complex properties, adds diagnostic buffering, and declines inline-resource/StaticResource-dependent subtrees.
  • Tests are SourceGen unit/harness tests, not UI/device tests; the relevant targeted regression command is dotnet test src/Controls/tests/SourceGen.UnitTests/SourceGen.UnitTests.csproj --filter "FullyQualifiedName~XamlIncrementalHotReloadE2ETests|FullyQualifiedName~SourceGenContextTests".
  • GitHub CLI authentication is unavailable in this environment; public REST API and local git were used for context.

Code Review Summary

Verdict: NEEDS_DISCUSSION
Confidence: low
Errors: 0 | Warnings: 2 | Suggestions: 1

Key code review findings:

  • src/Controls/src/SourceGen/UpdateComponentCodeWriter.cs:706 ResourceDictionary detection is namespace-blind and can falsely decline a custom ResourceDictionary type.
  • src/Controls/src/SourceGen/UpdateComponentCodeWriter.cs:662 only InvalidOperationException is caught in the speculative complex-property path; other unsupported visitor failures may abort generation.
  • src/Controls/tests/SourceGen.UnitTests/HotReload/XamlHotReloadTestHarness.cs:660 generated-method lookup could produce a more diagnostic assertion.

Fix Candidates

# Source Approach Test Result Files Changed Notes
PR PR #36730 Speculatively run InitializeComponent value/property visitors for newly-created element complex properties, buffer diagnostics, and decline resource-dependent subtrees. ⚠️ INCONCLUSIVE (Gate) SourceGenContext.cs, UpdateComponentCodeWriter.cs, SourceGen tests/harness Original PR; gate was already inconclusive due build/environment error and was not re-run.

🔬 Code Review — Deep Analysis

Code Review — PR #36730

Independent Assessment

What this changes: Improves incremental XAML Hot Reload UpdateComponent generation, especially newly-created element complex properties, adds buffered diagnostics, and adds a large source-generator/live metadata-update test harness.
Inferred motivation: Fix dropped complex properties like replacement-root CollectionView.ItemTemplate while expanding deterministic coverage.

Reconciliation with PR Narrative

Author claims: Fixes #36256, buffers speculative diagnostics, declines unsafe resource-dependent subtrees, and intentionally lets unexpected exceptions propagate.
Agreement/disagreement: Mostly matches. Two areas need discussion: the resource decline check appears over-broad, and the “unexpected exceptions propagate” choice may turn unsupported speculative subtrees into generator failures.

Prior Review Reconciliation

No prior ❌ Error findings found. Existing human comments are discussion/suggestions, not error-level blockers.

Blast Radius Assessment

  • Runs for all instances: No; source-generation path for incremental XAML Hot Reload updates.
  • Startup impact: No runtime startup impact.
  • Static/shared state: Test harness resets XamlHotReloadState; production change adds diagnostic buffering per SourceGenContext.

CI Status

  • Required-check result: undetermined — gh pr checks --required failed because gh is unauthenticated.
  • Classification: undetermined. REST fallback showed check-runs completed successfully, but required-check status could not be verified.
  • Action taken: capped confidence low; no GitHub comments posted.

Findings

⚠️ Warning — ResourceDictionary detection is namespace-blind

src/Controls/src/SourceGen/UpdateComponentCodeWriter.cs:706 checks only element.XmlType.Name == "ResourceDictionary". A custom <local:ResourceDictionary> inside a complex property would be treated as MAUI resources and silently skipped. Please also validate the MAUI namespace.

⚠️ Warning — Speculative complex-property path may abort generation

UpdateComponentCodeWriter.cs:662 catches only InvalidOperationException. If the speculative IC visitor path throws another exception for an unsupported/malformed subtree, the whole generator pass fails instead of emitting the intended skip marker. If propagation is intentional, this needs targeted tests/documentation.

💡 Suggestion — Harness failure message could be more diagnostic

XamlHotReloadTestHarness.cs:660 uses .First() for generated methods. FirstOrDefault() with a contextual assertion would make generator regressions easier to diagnose.

Failure-Mode Probing

  • Custom type named ResourceDictionary: currently causes a false skip even when no inline resources exist.
  • Non-InvalidOperationException from speculative visitors: propagates and can fail source generation.
  • Metadata updates unsupported: tests skip as designed, so CI may not exercise live-update paths unless environment enables it.

Verdict: NEEDS_DISCUSSION

Confidence: low
Summary: The core direction is sound, but the namespace-blind resource guard and exception-policy tradeoff should be resolved before treating this as ready. CI required-check state could not be verified due unavailable gh auth.


🛠️ Fix — Analysis & Comparison

Fix Candidates

# Source Approach Test Result Files Changed Notes
1 maui-expert-reviewer/code-review loop Namespace-aware inline ResourceDictionary guard using XmlType.IsOfAnyType("ResourceDictionary") plus a negative regression test for a custom local:ResourceDictionary. ✅ PASS 2 files Surgical hardening; improves PR's over-blocking guard but does not replace the PR's complex-property emission strategy.
2 maui-expert-reviewer/code-review loop Root replacement only; leave newly-created element complex properties skipped. ❌ FAIL 2 files Failed the issue-specific CollectionView.ItemTemplate oracle; proves root-assignment-only is insufficient.
3 maui-expert-reviewer/code-review loop Fail-closed on all speculative visitor exceptions instead of only InvalidOperationException. ✅ PASS (targeted), rejected by self-review 1 file Tests pass on normal paths, but broad exception swallowing hides generator defects and is weaker than PR's fail-fast policy.
PR PR #36730 Speculative InitializeComponent visitor pipeline for newly-created element complex properties, diagnostic buffering, and explicit resource-dependent decline guards. ⚠️ INCONCLUSIVE (Gate) 32 files Original PR; gate already inconclusive due build/environment error and was not re-run.

Cross-Pollination

Model/Reviewer Round New Ideas? Details
code-review skill + maui-expert-reviewer 1 Yes Suggested surgical DataTemplate emitter, coarse full-root rehydrate, runtime XAML fragment loader, first-class property-slot diffing, and resource-aware fragment source-gen.
try-fix-1 result 2 Yes The resource guard can be improved independently by namespace validation; this is a useful PR hardening patch but not a replacement for the core fix.
try-fix-2 result 2 No viable narrow root-only path Root replacement without complex-property emission fails the ItemTemplate half of #36256.
try-fix-3 result 2 No viable broad-catch path Broad fail-closed exception handling passes targeted tests but self-review rejects it as hiding unexpected source-generator failures.

Exhausted: Yes — the remaining expert ideas (full-root rehydrate, runtime XAML fragment loader, property-slot registry, resource-aware fragment source-gen, surgical DataTemplate factory extraction) are meaningfully different but substantially larger architectural changes. Within this loop, the tested alternatives show that root-only is insufficient and broad fail-closed policy is not better. Candidate 1 is the only passing improvement, but it is an incremental hardening patch rather than a complete replacement for the PR fix.

Selected Fix: PR's fix, with Candidate #1 recommended as an optional improvement — Candidate #1 is demonstrably better for the namespace-blind resource guard, but it does not replace the PR's core speculative complex-property emission required by #36256.

Candidate Details

try-fix-1

See ../try-fix-1/content.md.

try-fix-2

See ../try-fix-2/content.md.

try-fix-3

See ../try-fix-3/content.md.


📝 Recommended PR Title & Description

Assessment: ✏️ Recommend updating — the current title is good, but the winning pr-plus-reviewer candidate adds a namespace-aware ResourceDictionary guard and regression test that the current description does not mention.

Recommended title

XAML Hot Reload: Improve incremental generation and coverage

Recommended description

### Description of Change

This PR improves incremental XAML Hot Reload source generation and expands deterministic coverage for generator, compilation, and in-process metadata-update behavior.

- Preserves supported complex properties such as `CollectionView.ItemTemplate` when an update replaces a root element.
- Buffers diagnostics from speculative source generation so rejected attempts do not leak or duplicate diagnostics.
- Conservatively emits the existing explicit `skipped (not yet supported)` marker for inline-resource and `StaticResource`-dependent complex-property subtrees that cannot be resolved safely in the isolated speculative context.
- Uses namespace-aware `ResourceDictionary` detection for inline-resource decline guards so custom CLR/XAML types named `ResourceDictionary` do not falsely suppress otherwise supported complex-property emission.
- Adds a reusable source-generator Hot Reload harness for strict or diagnostic-tolerant generation, compilation, live metadata updates, chained deltas, multiple XAML documents, optional stable C# inputs, multiple retained instances, and application-host resource/theme scenarios.
- Reorganizes the larger AI-assisted behavior suites into logical partial-class files while preserving their fully qualified test names.

### Root Cause and Wave-1 Fix

`UpdateComponentCodeWriter` could create a newly added replacement root, but it skipped element-valued properties instead of applying the same value-creation and property-setting pipeline used by `InitializeComponent`. That silently dropped properties such as `CollectionView.ItemTemplate` in #36256.

The replacement-root path now speculatively emits supported complex properties and assigns them to the existing live page. The #36256 coverage verifies both generated source/compilation and a real metadata update on the same page instance, including a non-null `CollectionView.ItemTemplate` whose content contains the updated label.

Speculative generation introduced two safety constraints:

- Diagnostics must remain isolated until emission is accepted. `SourceGenContext` now supports explicit diagnostic buffering, flush, and discard behavior.
- A fresh speculative context cannot safely resolve ancestor resources or run the complete resource pipeline. Inline resources and direct, nested-markup, or element-form `StaticResource` references are therefore declined explicitly instead of producing a compileable false-success update that fails or resolves to `null` at runtime.

The inline-resource guard is intentionally namespace-aware: real MAUI `ResourceDictionary` elements still decline, while custom application types that happen to be named `ResourceDictionary` do not trip the guard.

Only the expected unsupported `InvalidOperationException` falls back to the skip marker; unexpected exceptions continue to propagate.

#36157 is covered only at the generator boundary: malformed-to-repaired input recomputes generator diagnostics and the repaired output compiles. This does not claim IDE Error List, Roslyn edit-session, or `dotnet watch` recovery. #36156 remains deferred to an IDE/Roslyn host test because its rude-edit session-poisoning behavior cannot be reproduced faithfully by a generator unit test.

### Reusable Hot Reload Harness

The harness:

- keeps one incremental generator driver and advances the Roslyn `EmitBaseline` through successive deltas;
- gives each scenario unique assembly, XAML path, and collectible `AssemblyLoadContext` identities;
- supports generation-only, compile-only, and full live-update paths;
- supports diagnostic-tolerant versions, multiple XAML documents, optional stable C# sources, and multiple retained roots;
- uses metadata-aware fact and theory attributes so live-update tests skip, rather than fail, when the runtime does not support `MetadataUpdater.ApplyUpdate`;
- resets `XamlHotReloadState`, restores `Application.Current`, unregisters roots from `XamlComponentRegistry`, disposes metadata/streams, and unloads the collectible context.

Generated `x:Name` fields still require manual C# stubs because `CodeBehindCodeWriter` is outside this harness.

### Wave-2 Coverage

The living AI-assisted index accounts for 55 test methods across 35 behavior IDs/capabilities covering:

- dynamic and merged resources, styles, themes, and application resources;
- visual states and behaviors;
- data/control templates, selectors, compiled bindings, and `BindableLayout`;
- bindings, markup extensions, and `MultiBinding`;
- nested generated controls and namescopes;
- multi-document and cross-assembly generator invalidation.

The metadata-enabled AI-assisted run reports **41 passed, 18 intentionally skipped, and 0 failed**. Theory rows affect the reported case count.

Passing tests are classified as live, construction, generator/compile guards, or explicit decline guards. Each skip-gated RED-PROBE names a nearby executable passing guard. The 18 skipped probes encode desired behavior for known gaps; they are not claimed as passing runtime coverage.

The larger resource/theme, visual-state, template, binding/markup, and nested-control suites are split into behavior-named partial files for reviewability without changing xUnit discovery, attributes, fixtures, or method identities.

### Known Limitations and Deferred Lanes

- A compiled `ResourceDictionary Source=` payload is unavailable in the in-memory collectible load context. Multi-document and `Source=` tests therefore verify tracking, generation, and compilation; their live payload probes remain skip-gated.
- Cross-assembly tests cover incremental-generator reference invalidation and caching only. Applying deltas to a separately loaded runtime assembly remains an integration lane.
- IDE/Hot Reload host behavior, Roslyn rude-edit recovery, `dotnet watch`, devices, native handlers, rendered output, and lifecycle behavior remain integration/host lanes.
- The AppThemeBinding live probe remains skip-gated because the current update writer supplies an `IProvideValueTarget` with a null `TargetProperty`; its passing guard proves generated branch capture only.
- Future keyed-template and selector factories remain tracked by #36482. Passing construction/source guards do not prove post-update future realization.
- Complex-property and collection reconciliation remains tracked by #36732. Explicit decline guards prove that unsupported updates are skipped and compile, not that live reconciliation succeeds.

### What NOT to Do

- Do not send speculative visitor diagnostics directly to the production diagnostic sink; rejected attempts must discard them.
- Do not emit resource-dependent subtrees from an isolated context and treat successful compilation as proof of runtime resolution.
- Do not use unqualified type-name matching for `ResourceDictionary` decline guards; custom application types can share that name and should not be falsely skipped.
- Do not catch broad exceptions and silently degrade unexpected generator failures.
- Do not use generated-source markers as evidence of live runtime behavior.
- Do not treat generator-only recovery coverage as proof of IDE or `dotnet watch` recovery.

### Issues Fixed

Fixes #36256

Related coverage and roadmap issues:

- #36157: generator diagnostic recomputation coverage only; host recovery is not fixed here.
- #36156: deferred IDE/Roslyn host scenario.
- #36482: future template/selector factory roadmap; not fixed by this PR.
- #36732: complex-property and collection reconciliation roadmap; not fixed by this PR.

### Test Coverage

```bash
DOTNET_MODIFIABLE_ASSEMBLIES=debug dotnet test src/Controls/tests/SourceGen.UnitTests/SourceGen.UnitTests.csproj -c Debug
DOTNET_MODIFIABLE_ASSEMBLIES=debug dotnet test src/Controls/tests/SourceGen.UnitTests/SourceGen.UnitTests.csproj -c Release
env -u DOTNET_MODIFIABLE_ASSEMBLIES dotnet test src/Controls/tests/SourceGen.UnitTests/SourceGen.UnitTests.csproj -c Debug
  • SourceGen.UnitTests Debug: 497 passed / 18 skipped / 0 failed (515 total).
  • SourceGen.UnitTests Release: 497 passed / 18 skipped / 0 failed (515 total).
  • XamlIncrementalHotReloadE2ETests: 13 passed / 0 skipped / 0 failed.
  • HotReload.AiAssisted: 41 passed / 18 skipped / 0 failed.
  • Default Debug with metadata updates explicitly unavailable: 475 passed / 37 skipped / 0 failed (512 total). xUnit reports each skip-gated theory once rather than once per data row.


</details>

---

<details>
<summary><strong>🏁 Report — Final Recommendation</strong></summary>
<br/>

# Comparative Report — PR #36730

## Candidates compared

| Rank | Candidate | Regression result | Assessment |
|---:|---|---|---|
| 1 | `pr-plus-reviewer` | PASS in sandbox targeted tests; PR gate inconclusive, not failing | Best candidate. Keeps the PR's required complex-property emission and diagnostic buffering, and adds the expert reviewer's namespace-aware `ResourceDictionary` guard with a regression test. |
| 2 | `pr` | Gate inconclusive; with-fix targeted tests passed in recorded gate | Core fix is sound and addresses #36256, but leaves a namespace-blind inline-resource guard that can falsely skip safe custom types named `ResourceDictionary`. |
| 3 | `try-fix-3` | PASS targeted, rejected by self-review | Passing tests are not sufficient because the broad `catch (Exception)` policy silently hides unexpected source-generator failures. This is weaker than the PR's intentional fail-fast policy. |
| 4 | `try-fix-1` | PASS targeted | Valuable hardening patch, but not a standalone replacement for the PR fix. It depends on the PR's speculative complex-property emission strategy and therefore ranks below PR-based candidates when considered alone. |
| 5 | `try-fix-2` | FAIL | Root replacement without complex-property emission fails the issue-specific `CollectionView.ItemTemplate` oracle, so it must rank below all passing or inconclusive non-failing candidates. |

## Key comparisons

### `pr` vs `try-fix-2`

`try-fix-2` proved that root replacement alone is insufficient. It still emits the explicit skip marker for `CollectionView.ItemTemplate` and fails `RootContentReplaced_WithItemTemplate_EmitsTemplate`. The PR's speculative visitor approach is necessary for #36256 because the replacement root must carry supported element-valued properties, not just be assigned with a type-correct root object.

### `pr` vs `try-fix-3`

`try-fix-3` broadens the speculative visitor catch from `InvalidOperationException` to all `Exception`. Although targeted tests passed, this weakens source-generator correctness by converting unexpected defects into silent skip markers. The PR's policy is preferable: expected unsupported paths can decline, while unexpected generator failures remain visible.

### `pr` vs `try-fix-1`

`try-fix-1` does not replace the PR's core fix; it improves a guard inside that fix. The expert reviewer independently confirmed the namespace-blind `ResourceDictionary` check as the only actionable inline finding. Incorporating try-fix-1 into the PR yields `pr-plus-reviewer`, which is better than either raw candidate alone.

## Winning candidate

**Winner:** `pr-plus-reviewer`

`pr-plus-reviewer` wins because it keeps the PR's complete fix for #36256, preserves the deliberate diagnostic buffering and fail-fast exception behavior, and applies the single actionable reviewer hardening with targeted passing coverage. The failed `try-fix-2` ranks lowest as required, and `try-fix-3` is rejected despite passing targeted tests because it masks unexpected generator failures.


</details>

</details>
<!-- SESSION:523ee85 END -->

---

<details>
<summary><strong>🧭 Next Steps</strong> — review latest findings</summary>
<br/>

No alternative fix was selected for this run. Review the session findings and CI results before merging.

</details>

Redth added 3 commits July 27, 2026 10:15
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 1b9bf3f3-3e24-49bf-b3eb-c075858ee563
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 1b9bf3f3-3e24-49bf-b3eb-c075858ee563
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 1b9bf3f3-3e24-49bf-b3eb-c075858ee563
@Redth

Redth commented Jul 27, 2026

Copy link
Copy Markdown
Member Author

No code change is needed for the standard dogfood instructions in #36730 (comment); this is informational guidance for testing the PR artifacts.

@Redth

Redth commented Jul 27, 2026

Copy link
Copy Markdown
Member Author

No code change is needed for the pipeline-start notification in #36730 (comment); it confirms that CI was queued successfully.

@Redth

Redth commented Jul 27, 2026

Copy link
Copy Markdown
Member Author

No code change is needed specifically for the informational gate summary in #36730 (comment). The with-fix path passed, while the synthetic base-side revert did not compile, so the gate was inconclusive rather than reporting a product regression.

@kubaflo
kubaflo marked this pull request as ready for review July 30, 2026 22:33
Copilot AI review requested due to automatic review settings July 30, 2026 22:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances the SourceGen-based XAML Incremental Hot Reload pipeline by extending UpdateComponent generation (notably for replacement-root scenarios) and introducing a reusable end-to-end Hot Reload harness that supports generator-only, compile, and in-process MetadataUpdater.ApplyUpdate validation across chained deltas and multi-document scenarios.

Changes:

  • Add diagnostic buffering/flush/discard support to SourceGenContext and thread diagnostic reporting through child generator contexts.
  • Improve UpdateComponentCodeWriter to speculatively emit supported complex properties when constructing new elements (with explicit decline paths for resource-dependent shapes).
  • Introduce a comprehensive reusable Hot Reload test harness and expand/split SourceGen Hot Reload coverage (E2E + AI-assisted suites) around generator/compile/live-update boundaries.

Reviewed changes

Copilot reviewed 36 out of 36 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/Controls/src/SourceGen/InitializeComponentCodeWriter.cs Updates SourceGenContext construction to pass an explicit diagnostic reporter.
src/Controls/src/SourceGen/SetPropertyHelpers.cs Ensures lambda/child generator contexts route diagnostics via the parent context.
src/Controls/src/SourceGen/SourceGenContext.cs Adds diagnostic buffering + configurable diagnostic reporter and parent-context forwarding.
src/Controls/src/SourceGen/UpdateComponentCodeWriter.cs Extends UC generation to emit supported complex properties on new-element construction and adds diagnostic isolation hooks.
src/Controls/src/SourceGen/Visitors/SetPropertiesVisitor.cs Passes diagnostic reporter into template contexts to align with buffered diagnostic flow.
src/Controls/tests/SourceGen.UnitTests/MetadataUpdateFactAttribute.cs Adds centralized gating logic and introduces MetadataUpdateTheoryAttribute.
src/Controls/tests/SourceGen.UnitTests/MetadataUpdateFactAttributeTests.cs Tests metadata-update gating behavior (skip vs. misconfiguration throw).
src/Controls/tests/SourceGen.UnitTests/SourceGenContextTests.cs Adds unit tests for buffered diagnostic forwarding/flush/discard behavior.
src/Controls/tests/SourceGen.UnitTests/SourceGeneratorDriver.cs Exposes a reusable analyzer-config-options provider factory for harness use.
src/Controls/tests/SourceGen.UnitTests/XamlIncrementalHotReloadE2ETests.cs Refactors E2E tests to use the new Hot Reload harness; adds successive-update scenarios and extra compile coverage.
src/Controls/tests/SourceGen.UnitTests/HotReload/XamlHotReloadHostFixture.cs Adds an Application host fixture for app-resource/theme scenarios.
src/Controls/tests/SourceGen.UnitTests/HotReload/XamlHotReloadTestHarness.cs Introduces the reusable generator/compile/live-update harness with versioned snapshots, EnC deltas, and ALC lifecycle management.
src/Controls/tests/SourceGen.UnitTests/HotReload/AiAssisted/README.md Documents harness intent, classifications, and the “living index” of test IDs and boundaries.
src/Controls/tests/SourceGen.UnitTests/HotReload/AiAssisted/BindingAndMarkupHotReloadTests.cs Adds shared scaffolding for binding/markup scenarios (support types + harness setup).
src/Controls/tests/SourceGen.UnitTests/HotReload/AiAssisted/BindingAndMarkupHotReloadTests.Bindings.cs Adds live probes for DynamicResource↔Binding swap behavior.
src/Controls/tests/SourceGen.UnitTests/HotReload/AiAssisted/BindingAndMarkupHotReloadTests.MarkupExtensions.cs Adds live probes for custom markup extension re-provisioning.
src/Controls/tests/SourceGen.UnitTests/HotReload/AiAssisted/BindingAndMarkupHotReloadTests.MultiBinding.cs Adds DOC-SKIP-GUARD coverage for MultiBinding complex-property decline behavior.
src/Controls/tests/SourceGen.UnitTests/HotReload/AiAssisted/CrossAssemblyHotReloadTests.cs Adds incremental-generator caching/invalidation probes for swapped vs. unchanged referenced assemblies.
src/Controls/tests/SourceGen.UnitTests/HotReload/AiAssisted/GeneratorRecoveryHotReloadTests.cs Adds generator-boundary malformed→repair diagnostic recomputation coverage.
src/Controls/tests/SourceGen.UnitTests/HotReload/AiAssisted/HarnessCapabilityTests.cs Adds capability-validation tests for app-host, theme flip, multi-doc, and multi-instance behavior.
src/Controls/tests/SourceGen.UnitTests/HotReload/AiAssisted/NestedControlHotReloadTests.cs Adds nested/custom-control hot reload scaffolding and shared helpers/stubs.
src/Controls/tests/SourceGen.UnitTests/HotReload/AiAssisted/NestedControlHotReloadTests.GeneratedRoots.cs Adds probes focused on nested generated roots and documented resource-decline behavior.
src/Controls/tests/SourceGen.UnitTests/HotReload/AiAssisted/NestedControlHotReloadTests.SameCompilation.cs Adds same-compilation nested-control coverage for identity/namescope/resource isolation across updates.
src/Controls/tests/SourceGen.UnitTests/HotReload/AiAssisted/ResourceAndThemeHotReloadTests.cs Adds shared scaffolding for resource/theme portfolio tests.
src/Controls/tests/SourceGen.UnitTests/HotReload/AiAssisted/ResourceAndThemeHotReloadTests.AppThemeBinding.cs Adds generator/compile boundary coverage for AppThemeBinding branch edits.
src/Controls/tests/SourceGen.UnitTests/HotReload/AiAssisted/ResourceAndThemeHotReloadTests.DynamicResources.cs Adds live probes for DynamicResource rename/reverse and app-scope fanout across retained/fresh roots.
src/Controls/tests/SourceGen.UnitTests/HotReload/AiAssisted/ResourceAndThemeHotReloadTests.MergedDictionaries.cs Adds DOC-SKIP-GUARD and multi-document tracking/atomicity scenarios for merged dictionaries and malformed→repair batches.
src/Controls/tests/SourceGen.UnitTests/HotReload/AiAssisted/ResourceAndThemeHotReloadTests.Styles.cs Adds DOC-SKIP-GUARD coverage for complex Style-based resources and inline Style edits.
src/Controls/tests/SourceGen.UnitTests/HotReload/AiAssisted/StructuralHotReloadTests.cs Adds structural/root replacement coverage including complex-property emission vs. explicit skip guards.
src/Controls/tests/SourceGen.UnitTests/HotReload/AiAssisted/TemplateAndSelectorHotReloadTests.cs Adds shared scaffolding for template/selector portfolio tests and reflective helpers.
src/Controls/tests/SourceGen.UnitTests/HotReload/AiAssisted/TemplateAndSelectorHotReloadTests.BindableLayout.cs Adds DOC-SKIP-GUARD coverage for attached complex property decline (BindableLayout.ItemTemplate).
src/Controls/tests/SourceGen.UnitTests/HotReload/AiAssisted/TemplateAndSelectorHotReloadTests.ControlTemplates.cs Adds construction-time isolation tests for ControlTemplate namescope/x:Reference/VSM TargetName behavior.
src/Controls/tests/SourceGen.UnitTests/HotReload/AiAssisted/TemplateAndSelectorHotReloadTests.DataTemplates.cs Adds keyed DataTemplate/selector/compiled-binding construction & generated-source guard coverage.
src/Controls/tests/SourceGen.UnitTests/HotReload/AiAssisted/VisualStateHotReloadTests.cs Adds shared scaffolding for visual-state/behavior portfolio tests.
src/Controls/tests/SourceGen.UnitTests/HotReload/AiAssisted/VisualStateHotReloadTests.Behaviors.cs Adds DOC-SKIP-GUARD coverage for behavior clear/re-add skip behavior.
src/Controls/tests/SourceGen.UnitTests/HotReload/AiAssisted/VisualStateHotReloadTests.VisualStates.cs Adds DOC-SKIP-GUARD coverage for VisualStateGroups skip behavior across versions and hosted theme scenarios.

Comment on lines +662 to +666
catch (InvalidOperationException)
{
context.DiscardBufferedDiagnostics();
return false;
}
Comment on lines +65 to +68
public void Detach(Page page)
{
ArgumentNullException.ThrowIfNull(page);

Resolve XAML Hot Reload harness conflicts with deterministic UpdateComponent generation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 53ff611b-9d3e-4671-8950-c2c0c3e93d64
Copilot AI review requested due to automatic review settings July 30, 2026 22:52
@kubaflo
kubaflo merged commit 5199eaa into net11.0 Jul 30, 2026
5 of 14 checks passed
@kubaflo
kubaflo deleted the redth-hot-reload-test-harness branch July 30, 2026 22:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 36 out of 36 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

src/Controls/tests/SourceGen.UnitTests/HotReload/XamlHotReloadHostFixture.cs:68

  • Detach() should guard against use-after-dispose for consistency with Attach/Dispatch/SetAppTheme. Without a disposed check, a late Detach call (e.g., during cleanup after a fixture has been disposed due to an earlier failure) can still mutate the fixture's Application.MainPage even after Application.Current has been restored, which is surprising and makes teardown ordering bugs harder to detect.
	public void Detach(Page page)
	{
		ArgumentNullException.ThrowIfNull(page);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-tooling XAML & C# Hot Reload, XAML Editor, Live Visual Tree, Live Preview, Debugging s/agent-changes-requested AI agent recommends changes - found a better alternative or issues s/agent-fix-pr-picked AI could not beat the PR fix - PR is the best among all candidates s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants