Skip to content

[release/10.0.1xx-sr7] [iOS] Fix StaticResource Hot Reload crash on iOS - #35425

Merged
PureWeen merged 4 commits into
release/10.0.1xx-sr7from
backport/pr-35020-to-release/10.0.1xx-sr7
May 15, 2026
Merged

[release/10.0.1xx-sr7] [iOS] Fix StaticResource Hot Reload crash on iOS#35425
PureWeen merged 4 commits into
release/10.0.1xx-sr7from
backport/pr-35020-to-release/10.0.1xx-sr7

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Backport of #35020 to release/10.0.1xx-sr7

/cc @kubaflo @StephaneDelcroix

StephaneDelcroix and others added 3 commits May 13, 2026 17:52
During Hot Reload, renaming a resource key in Styles.xaml causes the app
to crash on iOS. PR #33859 changed StaticResourceExtension to always
throw for missing resources even when ExceptionHandler2 is set. On iOS,
this exception propagates through UIKit lifecycle callbacks during Shell
item setup (ViewDidLoad → GetOrCreateContent → ProvideValue), corrupting
Shell state and terminating the app.

Fix: When ExceptionHandler2 is set (Hot Reload / IDE context), report
the missing resource error to the handler and return null instead of
throwing. In ApplyPropertiesVisitor, skip the property assignment for
StaticResourceExtension failures during Hot Reload. The page loads with
degraded styling (missing resource not applied) but remains functional,
matching the pre-#33859 behavior during Hot Reload.

The error is still reported to the IDE via ExceptionHandler2, so the
Error List shows the missing resource. Without a handler (normal app
launch), the exception still propagates as before.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- ApplyPropertiesVisitor: invoke Context.ExceptionHandler before skipping
  property (defense-in-depth, avoids silently dropping errors)
- StaticResourceExtension: document null return semantics for reference
  vs value-type properties
- Test: verify exception message content in handler callback
- Test: assert degraded styling (FontSize reverts to default)
- Test: add comment explaining XamlC exclusion from Hot Reload tests

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…fy defense-in-depth comment

- StaticResourceExtension: Correct comment about null behavior for value-type
  properties — assignment is skipped with an additional diagnostic, not silently
  ignored.
- ApplyPropertiesVisitor: Simplify defense-in-depth comment to be more direct
  about the Hot Reload crash prevention purpose.

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

Copy link
Copy Markdown
Member

/azp run maui-pr-uitests, maui-pr-devicetests

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 2 pipeline(s).
@github-actions

Copy link
Copy Markdown
Contributor Author

🚀 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 -- 35425

Or

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

Copy link
Copy Markdown
Contributor

/azp run maui-pr-uitests , maui-pr-devicetests

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 2 pipeline(s).
@PureWeen
PureWeen merged commit 2d53cc1 into release/10.0.1xx-sr7 May 15, 2026
165 of 168 checks passed
@PureWeen
PureWeen deleted the backport/pr-35020-to-release/10.0.1xx-sr7 branch May 15, 2026 13:55
@github-actions github-actions Bot added this to the .NET 10 SR7 milestone May 15, 2026
kubaflo pushed a commit that referenced this pull request May 19, 2026
<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->

### Description of Change

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


Cherry-picks test fixes and snapshot additions from multiple backport
PRs:

- **PR #35434** — Fixed CI failure (removed flaky test attributes from
Bugzilla40333) and removed Issue9095 test
- **PR #35426** — Added mac and Windows snapshots for
`VerifySearchBarHeightRequestValues`, updated iOS snapshots
- **PR #35427** — Resolved device test failures in
`ScrollViewHandler.Windows.cs`
- **PR #35424** — Added mac and Windows snapshots for
`LinearGradientBrushTransparentStopsShouldNotBeOpaque`
- **PR #35425** — Removed failing test: "Missing ControlTemplate with
exception handler should throw" (`StaticResourceTests.cs`)

## Changes

| File | Change |
|------|--------|
| `Bugzilla40333.cs` | Removed 2 lines (CI fix) |
| `Issue9095.cs` | Deleted |
| `ScrollViewHandler.Windows.cs` | Fixed device test failures |
| `StaticResourceTests.cs` | Deleted |
| SearchBar snapshots (mac/windows/iOS) | Added/updated |
| LinearGradientBrush snapshots (mac/windows) | Added |

---------

Co-authored-by: Dhivya-SF4094 <127717131+Dhivya-SF4094@users.noreply.github.com>
Co-authored-by: devanathan-vaithiyanathan <114395405+devanathan-vaithiyanathan@users.noreply.github.com>
Co-authored-by: Vignesh-SF3580 <102575140+Vignesh-SF3580@users.noreply.github.com>
PureWeen pushed a commit that referenced this pull request Jun 2, 2026
<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->

### Description of Change

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


Cherry-picks test fixes and snapshot additions from multiple backport
PRs:

- **PR #35434** — Fixed CI failure (removed flaky test attributes from
Bugzilla40333) and removed Issue9095 test
- **PR #35426** — Added mac and Windows snapshots for
`VerifySearchBarHeightRequestValues`, updated iOS snapshots
- **PR #35427** — Resolved device test failures in
`ScrollViewHandler.Windows.cs`
- **PR #35424** — Added mac and Windows snapshots for
`LinearGradientBrushTransparentStopsShouldNotBeOpaque`
- **PR #35425** — Removed failing test: "Missing ControlTemplate with
exception handler should throw" (`StaticResourceTests.cs`)

## Changes

| File | Change |
|------|--------|
| `Bugzilla40333.cs` | Removed 2 lines (CI fix) |
| `Issue9095.cs` | Deleted |
| `ScrollViewHandler.Windows.cs` | Fixed device test failures |
| `StaticResourceTests.cs` | Deleted |
| SearchBar snapshots (mac/windows/iOS) | Added/updated |
| LinearGradientBrush snapshots (mac/windows) | Added |

---------

Co-authored-by: Dhivya-SF4094 <127717131+Dhivya-SF4094@users.noreply.github.com>
Co-authored-by: devanathan-vaithiyanathan <114395405+devanathan-vaithiyanathan@users.noreply.github.com>
Co-authored-by: Vignesh-SF3580 <102575140+Vignesh-SF3580@users.noreply.github.com>
PureWeen added a commit that referenced this pull request Jun 11, 2026
…xx-sr8 (#35810)

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

## Cut-then-merge step 2 of 2

SR8 was cut from `main` at
[`e02d6b6dc2`](e02d6b6)
(commit "Add gh-aw rerun review scanner (#35685)"). This PR pulls the
SR7 stabilization work into SR8 so SR8 contains everything that's in
SR7.

- **Base:** `release/10.0.1xx-sr8` @
[`e02d6b6dc2`](e02d6b6)
- **Merging in:** `release/10.0.1xx-sr7` @
[`9da598b4a1`](9da598b)
(PatchVersion bump to 71)
- **Merge base:**
[`f8cb875e`](f8cb875eee)
("[Testing] The Windows WebView category is removed from CI…" #35335)
- **Strategy:** non-fast-forward merge commit (preserves both branches'
history)

## Conflict resolution

Two trivial conflicts, both resolved by taking the SR8 (`HEAD`) side:

| File | Why it conflicted | Resolution |
| --- | --- | --- |
|
[`eng/Versions.props`](https://github.com/dotnet/maui/blob/release/10.0.1xx-sr8/eng/Versions.props)
| SR7 bumped `PatchVersion` 70→71 (#35786); SR8 starts at 80 | Keep
`PatchVersion=80` (SR8 is the higher patch band) |
|
`src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellSectionRenderer.cs`
| Whitespace-only difference (`false; //` vs `false; //`) in two
comments | Keep SR8's whitespace |

No semantic conflicts.

## Inherited from SR7

26 SR7-only commits land in SR8 via this merge. The source PRs are:

<details>
<summary>Source PRs (43, deduped by commit)</summary>

#35020, #35072, #35092, #35150, #35223, #35299, #35305, #35347, #35356,
#35359, #35360, #35421, #35423, #35424, #35425, #35426, #35427, #35428,
#35430, #35434, #35441, #35447, #35461, #35480, #35503, #35520, #35521,
#35559, #35566, #35585, #35625, #35642, #35664, #35689, #35690, #35691,
#35692, #35693, #35694, #35703, #35744, #35768, #35786

Includes the SR7 revert chain:
- #35689 — Revert PR #30068 (FontImageSource centering on Windows)
- #35694 — Revert TalkBack RadioButton fix
- #35703 — Revert Shell.NavBarIsVisible fix
- #35744 — Revert HybridWebView WebView fix
- #35461, #35503 — additional Android reverts
</details>

After this lands, the release-readiness tracker can survey
`release/10.0.1xx-sr8` directly instead of using `-Candidate
-InheritFromPriorSr` mode against SR7.
PureWeen pushed a commit that referenced this pull request Jun 11, 2026
<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->

### Description of Change

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


Cherry-picks test fixes and snapshot additions from multiple backport
PRs:

- **PR #35434** — Fixed CI failure (removed flaky test attributes from
Bugzilla40333) and removed Issue9095 test
- **PR #35426** — Added mac and Windows snapshots for
`VerifySearchBarHeightRequestValues`, updated iOS snapshots
- **PR #35427** — Resolved device test failures in
`ScrollViewHandler.Windows.cs`
- **PR #35424** — Added mac and Windows snapshots for
`LinearGradientBrushTransparentStopsShouldNotBeOpaque`
- **PR #35425** — Removed failing test: "Missing ControlTemplate with
exception handler should throw" (`StaticResourceTests.cs`)

## Changes

| File | Change |
|------|--------|
| `Bugzilla40333.cs` | Removed 2 lines (CI fix) |
| `Issue9095.cs` | Deleted |
| `ScrollViewHandler.Windows.cs` | Fixed device test failures |
| `StaticResourceTests.cs` | Deleted |
| SearchBar snapshots (mac/windows/iOS) | Added/updated |
| LinearGradientBrush snapshots (mac/windows) | Added |

---------

Co-authored-by: Dhivya-SF4094 <127717131+Dhivya-SF4094@users.noreply.github.com>
Co-authored-by: devanathan-vaithiyanathan <114395405+devanathan-vaithiyanathan@users.noreply.github.com>
Co-authored-by: Vignesh-SF3580 <102575140+Vignesh-SF3580@users.noreply.github.com>
PureWeen pushed a commit that referenced this pull request Jun 22, 2026
<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->

### Description of Change

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


Cherry-picks test fixes and snapshot additions from multiple backport
PRs:

- **PR #35434** — Fixed CI failure (removed flaky test attributes from
Bugzilla40333) and removed Issue9095 test
- **PR #35426** — Added mac and Windows snapshots for
`VerifySearchBarHeightRequestValues`, updated iOS snapshots
- **PR #35427** — Resolved device test failures in
`ScrollViewHandler.Windows.cs`
- **PR #35424** — Added mac and Windows snapshots for
`LinearGradientBrushTransparentStopsShouldNotBeOpaque`
- **PR #35425** — Removed failing test: "Missing ControlTemplate with
exception handler should throw" (`StaticResourceTests.cs`)

## Changes

| File | Change |
|------|--------|
| `Bugzilla40333.cs` | Removed 2 lines (CI fix) |
| `Issue9095.cs` | Deleted |
| `ScrollViewHandler.Windows.cs` | Fixed device test failures |
| `StaticResourceTests.cs` | Deleted |
| SearchBar snapshots (mac/windows/iOS) | Added/updated |
| LinearGradientBrush snapshots (mac/windows) | Added |

---------

Co-authored-by: Dhivya-SF4094 <127717131+Dhivya-SF4094@users.noreply.github.com>
Co-authored-by: devanathan-vaithiyanathan <114395405+devanathan-vaithiyanathan@users.noreply.github.com>
Co-authored-by: Vignesh-SF3580 <102575140+Vignesh-SF3580@users.noreply.github.com>
kubaflo pushed a commit that referenced this pull request Jun 25, 2026
<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->

### Description of Change

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


Cherry-picks test fixes and snapshot additions from multiple backport
PRs:

- **PR #35434** — Fixed CI failure (removed flaky test attributes from
Bugzilla40333) and removed Issue9095 test
- **PR #35426** — Added mac and Windows snapshots for
`VerifySearchBarHeightRequestValues`, updated iOS snapshots
- **PR #35427** — Resolved device test failures in
`ScrollViewHandler.Windows.cs`
- **PR #35424** — Added mac and Windows snapshots for
`LinearGradientBrushTransparentStopsShouldNotBeOpaque`
- **PR #35425** — Removed failing test: "Missing ControlTemplate with
exception handler should throw" (`StaticResourceTests.cs`)

## Changes

| File | Change |
|------|--------|
| `Bugzilla40333.cs` | Removed 2 lines (CI fix) |
| `Issue9095.cs` | Deleted |
| `ScrollViewHandler.Windows.cs` | Fixed device test failures |
| `StaticResourceTests.cs` | Deleted |
| SearchBar snapshots (mac/windows/iOS) | Added/updated |
| LinearGradientBrush snapshots (mac/windows) | Added |

---------

Co-authored-by: Dhivya-SF4094 <127717131+Dhivya-SF4094@users.noreply.github.com>
Co-authored-by: devanathan-vaithiyanathan <114395405+devanathan-vaithiyanathan@users.noreply.github.com>
Co-authored-by: Vignesh-SF3580 <102575140+Vignesh-SF3580@users.noreply.github.com>
kubaflo pushed a commit that referenced this pull request Jul 3, 2026
<!--
!!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING
MAIN. !!!!!!!
-->

### Description of Change

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


Cherry-picks test fixes and snapshot additions from multiple backport
PRs:

- **PR #35434** — Fixed CI failure (removed flaky test attributes from
Bugzilla40333) and removed Issue9095 test
- **PR #35426** — Added mac and Windows snapshots for
`VerifySearchBarHeightRequestValues`, updated iOS snapshots
- **PR #35427** — Resolved device test failures in
`ScrollViewHandler.Windows.cs`
- **PR #35424** — Added mac and Windows snapshots for
`LinearGradientBrushTransparentStopsShouldNotBeOpaque`
- **PR #35425** — Removed failing test: "Missing ControlTemplate with
exception handler should throw" (`StaticResourceTests.cs`)

## Changes

| File | Change |
|------|--------|
| `Bugzilla40333.cs` | Removed 2 lines (CI fix) |
| `Issue9095.cs` | Deleted |
| `ScrollViewHandler.Windows.cs` | Fixed device test failures |
| `StaticResourceTests.cs` | Deleted |
| SearchBar snapshots (mac/windows/iOS) | Added/updated |
| LinearGradientBrush snapshots (mac/windows) | Added |

---------

Co-authored-by: Dhivya-SF4094 <127717131+Dhivya-SF4094@users.noreply.github.com>
Co-authored-by: devanathan-vaithiyanathan <114395405+devanathan-vaithiyanathan@users.noreply.github.com>
Co-authored-by: Vignesh-SF3580 <102575140+Vignesh-SF3580@users.noreply.github.com>
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 9, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

4 participants