Skip to content

[release/11.0.1xx-preview7] [XAML] Re-enable Incremental Hot Reload by default in Debug - #37163

Merged
PureWeen merged 1 commit into
release/11.0.1xx-preview7from
pureween-backport-pr-37157-to-preview7
Aug 6, 2026
Merged

[release/11.0.1xx-preview7] [XAML] Re-enable Incremental Hot Reload by default in Debug#37163
PureWeen merged 1 commit into
release/11.0.1xx-preview7from
pureween-backport-pr-37157-to-preview7

Conversation

@PureWeen

@PureWeen PureWeen commented Aug 6, 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!

Backport of #37157 to release/11.0.1xx-preview7

Re-enables XAML Incremental Hot Reload by default for Debug builds while preserving the opt-out and keeping Release/publish builds disabled by default. The legacy hot-reload fallback MSBuild test remains explicitly pinned to XIHR off.

Validation

  • The backport patch matches squash merge commit 6bb9daf7aa47bde8e750635959e7c4db3c46561e exactly (git range-diff).
  • dotnet build Microsoft.Maui.BuildTasks.slnf passed with 0 warnings and 0 errors.
  • MSBuildTests.HotReloadSupportForXSG passed for Debug and Release (2/2).
  • git diff --check passes.

cc @PureWeen @Redth

<!-- Please let the below note in for people that find this PR -->
> [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

### Description

Re-enables XAML Incremental Hot Reload (XIHR) by default for Debug
builds on `net11.0`. This undoes the temporary opt-out from #36832 now
that the deterministic generation and Edit-and-Continue stability fixes
from #36833 are merged.

### Behavior

| Configuration | `EnableMauiIncrementalHotReload` | `MauiXamlHotReload`
|
|---|---|---|
| Debug (default) | `true` | `SourceGen` |
| Release / publish (default) | `false` | `Legacy` |
| Debug + explicit `false` | `false` | `Legacy` |
| Release + explicit `true` | `true` | `SourceGen` |

The legacy fallback test remains explicitly pinned to XIHR-off and its
comment now reflects the restored Debug default.

### Testing

- Evaluated the MSBuild property cascade for the four configurations
above.
- `MSBuildTests.BuildAProject`
- `MSBuildTests.HotReloadSupportForXSG` (Debug and Release)

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings August 6, 2026 23:04
@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.

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 backports the change to re-enable XAML Incremental Hot Reload (XIHR) by default for Debug builds while keeping Release/publish defaults disabled, and updates the related MSBuild unit test comment to reflect the new default behavior.

Changes:

  • Sets EnableMauiIncrementalHotReload to default true in Debug (when unset) and false otherwise.
  • Keeps MauiXamlHotReload defaulting to SourceGen when XIHR is enabled, otherwise Legacy.
  • Updates the MSBuild test comment to reflect XIHR being on-by-default in Debug.
Show a summary per file
File Description
src/Controls/tests/Xaml.UnitTests/MSBuild/MSBuildTests.cs Updates test commentary to reflect the restored Debug default while still pinning XIHR off for the legacy fallback scenario.
src/Controls/src/Build.Tasks/nuget/buildTransitive/netstandard2.0/Microsoft.Maui.Controls.targets Implements the Debug-default property cascade for XIHR and ties the IDE hot reload mode default to that value.

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 1

registry calls and runtime switch trim away. Set <EnableMauiIncrementalHotReload>false</...> to
opt out (legacy XAML Hot Reload remains available as a fallback). Resolves to an explicit
true/false so the value always flows to the source generator and runtime config. -->
<EnableMauiIncrementalHotReload Condition="'$(EnableMauiIncrementalHotReload)' == '' and '$(Configuration)' == 'Debug'">true</EnableMauiIncrementalHotReload>
@PureWeen
PureWeen merged commit 6f755e5 into release/11.0.1xx-preview7 Aug 6, 2026
2 of 11 checks passed
@PureWeen
PureWeen deleted the pureween-backport-pr-37157-to-preview7 branch August 6, 2026 23:11
@PureWeen
PureWeen temporarily deployed to copilot-pat-pool August 6, 2026 23:17 — with GitHub Actions Inactive
@github-actions

github-actions Bot commented Aug 6, 2026

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 -- 37163

Or

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

@PureWeen
PureWeen temporarily deployed to copilot-pat-pool August 6, 2026 23:17 — with GitHub Actions Inactive
@PureWeen
PureWeen temporarily deployed to copilot-pat-pool August 6, 2026 23:18 — with GitHub Actions Inactive
@PureWeen
PureWeen temporarily deployed to copilot-pat-pool August 6, 2026 23:20 — with GitHub Actions Inactive
@github-actions github-actions Bot added this to the .NET 11.0-preview7 milestone Aug 6, 2026
@PureWeen
PureWeen temporarily deployed to copilot-pat-pool August 6, 2026 23:22 — with GitHub Actions Inactive
davidortinau added a commit to davidortinau/docs-maui that referenced this pull request Aug 11, 2026
…binding fallback

XAML Incremental Hot Reload is enabled by default for Debug builds and
disabled for Release and publish builds, per dotnet/maui#37163 (backport
of #37157), which reverted the temporary opt-out in #36832. Show the
MSBuild property as an opt-out instead of an opt-in, and note that edits
are applied by .NET Hot Reload hosts such as dotnet watch, because the
engine uses a MetadataUpdateHandler.

Correct the AOT-safe compiled RelativeSource binding fallback. For an
x:Reference binding the compiler resolves the referenced element's type
and compiles against it, and falls back to the runtime binding path only
when the binding path can't be compiled against that type.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 35c845e8-c26a-4489-b9de-2c1d32638c6d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants