Skip to content

Don't set UseInterpreter for iOS or Mac Catalyst. - #39032

Merged
kubaflo merged 3 commits into
dotnet:net11.0from
rolfbjarne:no-interpreter
Oct 1, 2026
Merged

kubaflo merged 3 commits into
dotnet:net11.0from
rolfbjarne:no-interpreter

Conversation

@rolfbjarne

@rolfbjarne rolfbjarne commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

Description of Change

Setting UseInterpreter=true for iOS or Mac Catalyst raises a warning in .NET 11:

The property 'UseInterpreter' has no effect when not using the Mono runtime (for instance when using CoreCLR).

so don't set UseInterpreter for iOS or Mac Catalyst (as the warning says, it has no effect) when running on .NET 11+.

Dhivya-SF4094 and others added 2 commits September 30, 2026 12:50
…otnet#37674)

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

### Issue Detail
On Mac Catalyst, VoiceOver announces selectable task items in
a CollectionView only by name, without an actionable role. Although
users can activate the item with Control + Option + Space, they are not
informed that it is interactive. VoiceOver should announce an
appropriate role, such as “button,” for selectable items.


### Root Cause

- On iOS/MacCatalyst, VoiceOver announced only a CollectionView item's
text and did not announce its role/interactivity (for example,
"Button"), even when SelectionMode made the item selectable.
- UpdateAccessibilityTraits unconditionally
applied UIAccessibilityTrait.Button to the cell's first templated child
view. When that child was a non-accessible container, such as
a Grid or Border wrapping a Label, the trait was applied to a view that
VoiceOver did not use as the accessibility element.
- The nested descendant that was actually exposed to VoiceOver
(IsAccessibilityElement == true) never received the trait, so VoiceOver
announced only the item's text without indicating that it was
selectable/interactable.

### Description of Change

- The fix changes the trait assignment to recursively search the first
templated child’s view hierarchy for the first view
with IsAccessibilityElement == true.
The UIAccessibilityTrait.Button trait is then applied directly to that
accessibility element.
- The search intentionally does not descend into UIControl subtrees.
This preserves the native accessibility roles of controls such
as UIButton, UITextField, and UISwitch, rather than overriding their
existing accessibility behavior.
- For selectable items, the button trait is added to the discovered
accessibility element. When SelectionMode.None is used, the trait is
removed.
- This ensures that the trait is applied to the same native view that
VoiceOver uses as the accessibility target. Consequently, VoiceOver
correctly announces both the item's content and its interactive role,
for example, “Survey Employees, Button.”

### Validated the behaviour in the following platforms
- [ ] Android
- [ ] Windows
- [ ] iOS
- [x] Mac

### Issues Fixed:
Fixes dotnet#37140 

### Screenshots
| Before  | After |
|---------|--------|
| <video
src="https://github.com/user-attachments/assets/9b00bcc3-bb31-49f6-9f97-1fd0f3891d5a">
| <video
src="https://github.com/user-attachments/assets/93426da3-564b-46dd-b5f8-60adfedb195d">
|
Setting UseInterpreter=true for iOS or Mac Catalyst raises a warning in .NET 11:

> The property 'UseInterpreter' has no effect when not using the Mono runtime (for instance when using CoreCLR).

so don't set UseInterpreter for iOS or Mac Catalyst (as the warning says, it has no effect).
Copilot AI balanced review requested due to automatic review settings September 30, 2026 18:03
@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 -- 39032

Or

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

@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.

@github-actions github-actions Bot added the area-tooling XAML & C# Hot Reload, XAML Editor, Live Visual Tree, Live Preview, Debugging label Sep 30, 2026

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.

Copilot review overview

🟡 Changes recommended

The unconditional removal regresses interpreter and Hot Reload behavior for supported pre-.NET 11 iOS and Mac Catalyst targets.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Removes automatic UseInterpreter configuration for iOS and Mac Catalyst to avoid .NET 11 CoreCLR warnings.

Changes:

  • Limits the Debug interpreter default to Android, Windows, and Tizen.
  • However, this also removes the required Mono default from pre-.NET 11 Apple TFMs.
File Description
Microsoft.Maui.Controls.Common.targets Removes iOS and Mac Catalyst from the UseInterpreter condition.

@kubaflo

kubaflo commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

Should this be net11 only?

@kubaflo kubaflo 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.

Should this be net11 only?

@kubaflo

This comment has been minimized.

@kubaflo

kubaflo commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

/azp run

@github-actions github-actions Bot added the s/agent-review-in-progress AI review is currently running for this PR label Sep 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Note

🔍 /review started

AzDO build 15523186 is running for catalyst.

The s/agent-review-in-progress label stays on this PR while the run is active. The final recommendation and outcome labels are posted only after Gate, expert review, and Deep UI tests finish.

MauiBot

This comment was marked as outdated.

@MauiBot MauiBot added s/agent-changes-requested AI agent recommends changes - found a better alternative or issues s/agent-fix-win AI found a better alternative fix than the PR s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review) and removed s/agent-review-in-progress AI review is currently running for this PR labels Sep 30, 2026
Copilot AI balanced review requested due to automatic review settings October 1, 2026 06:04
@rolfbjarne

Copy link
Copy Markdown
Member Author

Should this be net11 only?

Yes, .NET 11 only. I've updated the PR to fix this.

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.

Copilot review overview

🟡 Changes recommended

The implementation is sound, but the PR title inaccurately implies the change applies to every .NET version.

Review effort: Balanced
Findings: 1 Low severity

Open (1)
Resolved since last review (1)

'$([MSBuild]::GetTargetPlatformIdentifier($(TargetFramework)))' == 'windows' or
'$([MSBuild]::GetTargetPlatformIdentifier($(TargetFramework)))' == 'tizen')">True</UseInterpreter>
<UseInterpreter Condition="'$(UseInterpreter)' == '' and '$(Configuration)' == 'Debug' and
$([MSBuild]::VersionLessThan($(TargetFrameworkVersion), 11.0)) and
@kubaflo

This comment has been minimized.

@kubaflo

kubaflo commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

/azp run

@github-actions github-actions Bot added the s/agent-review-in-progress AI review is currently running for this PR label Oct 1, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Note

🔍 /review started

AzDO build 15531396 is running for catalyst.

The s/agent-review-in-progress label stays on this PR while the run is active. The final recommendation and outcome labels are posted only after Gate, expert review, and Deep UI tests finish.

kubaflo
kubaflo previously approved these changes Oct 1, 2026
@kubaflo
kubaflo changed the base branch from main to net11.0 October 1, 2026 10:43
@kubaflo
kubaflo dismissed their stale review October 1, 2026 10:43

The base branch was changed.

@kubaflo
kubaflo merged commit 72fd6d0 into dotnet:net11.0 Oct 1, 2026
178 of 199 checks passed
@github-actions github-actions Bot added this to the .NET 11.0-rc2 milestone Oct 1, 2026
@MauiBot

MauiBot commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator

AI Review Summary

@rolfbjarne — new AI review results are available based on commit 25a826b.

Gate No Tests Confidence Low Platform Mac Catalyst


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

Gate Result: ⚠️ SKIPPED

No tests were detected in this PR.

Recommendation: Add tests to verify the fix using the write-tests-agent.


📋 Pre-Flight — Context & Validation

PR #39032 Pre-Flight

Context

  • PR: Don't set UseInterpreter for iOS or Mac Catalyst.
  • Base: dotnet/maui:main
  • Head: rolfbjarne/maui:no-interpreter
  • Problem: In .NET 11, iOS and Mac Catalyst use CoreCLR, so setting UseInterpreter=true produces: The property 'UseInterpreter' has no effect when not using the Mono runtime (for instance when using CoreCLR).
  • Required compatibility: Preserve MAUI's Debug default of UseInterpreter=true for iOS and Mac Catalyst before .NET 11, where the Mono interpreter remains relevant.
  • Platform: Mac Catalyst (catalyst).

Direct Diff Inspection

The PR changes only:

src/Controls/src/Build.Tasks/nuget/buildTransitive/netstandard2.0/Microsoft.Maui.Controls.Common.targets

It removes iOS and Mac Catalyst from the existing unconditional Debug-platform list, then adds a second UseInterpreter assignment for those platforms guarded by:

$([MSBuild]::VersionLessThan($(TargetFrameworkVersion), 11.0))

Android, Windows, and Tizen retain the existing Debug default. The current PR therefore uses a target-framework-version split to preserve pre-.NET 11 behavior.

Review Context

  • An earlier revision removed iOS/Mac Catalyst for every TFM and was corrected after review identified the pre-.NET 11 regression.
  • The current implementation addresses that regression, but no automated test was added.
  • The title is broader than the implementation because the implementation intentionally continues setting the property before .NET 11.

Test Contract

The completed gate reported: SKIPPED — no tests detected in this PR; it must not be re-run or overwritten.

No PR-specific primary test exists. The previously detected mandatory Catalyst regression categories are Button, Label, and Layout. Each candidate may run only:

pwsh .github/scripts/BuildAndRunHostApp.ps1 -Platform catalyst -TestFilter "TestCategory=Button|TestCategory=Label|TestCategory=Layout"

This command is a behavioral regression check; because the PR lacks a focused MSBuild property test, it cannot by itself prove both the .NET 10 and .NET 11 property-evaluation branches.

Try-Fix Boundary

  • Each attempt may modify only the baseline script's RevertedFiles allow-list.
  • Candidate 1 must differ mechanistically from the PR's TargetFrameworkVersion < 11.0 split.
  • Candidate 2 must additionally avoid candidate 1's recorded mechanism.
  • Each attempt gets one implementation/test pass and at most one focused correction/retest.
  • Every attempt must run the try-fix skill's inline expert self-review and exact restore workflow.

🔬 Code Review — Deep Analysis

Code Review — PR #39032

Independent Assessment

What this changes: The submitted target stops applying MAUI's Debug UseInterpreter=True default to iOS and Mac Catalyst on .NET 11 and later, while retaining that default for those platforms before .NET 11. Android, Windows, and Tizen keep their existing behavior, and an explicit project value still takes precedence.

Inferred motivation: .NET 11 Apple targets use CoreCLR, where UseInterpreter has no effect and emits a warning, while earlier Apple targets still use Mono and require the existing MAUI Debug default.

Findings

No actionable inline defects were found. The expert reviewer wrote inline-findings.json as an empty JSON array.

Build and MSBuild Assessment

  • The VersionLessThan($(TargetFrameworkVersion), 11.0) condition directly expresses the compatibility boundary described by the code change.
  • The existing '$(UseInterpreter)' == '' guard preserves explicit user configuration.
  • The split is localized to iOS and Mac Catalyst; Android, Windows, and Tizen remain in the original Debug default group.
  • No external tool output is classified by this change.

Blast Radius and Failure-Mode Probing

  • All instances: The imported target affects Debug builds using Microsoft.Maui.Controls, but the new condition changes only iOS and Mac Catalyst property evaluation.
  • Startup impact: None at application runtime; this is build-time property evaluation.
  • Static/shared state: None.
  • Explicit override: A non-empty UseInterpreter value bypasses both defaults.
  • Pre-.NET 11 Apple target: The second assignment retains UseInterpreter=True.
  • .NET 11+ Apple target: Neither assignment supplies a default, avoiding the CoreCLR warning.
  • Other supported platforms: Their original assignment remains unchanged.

CI and Test Evidence

  • The trusted Gate was skipped because the PR adds no tests; it was not rerun.
  • The review environment could not authenticate gh, so required-check status was not independently established by the expert pass.
  • No focused property-evaluation test proves both the pre-.NET 11 and .NET 11+ branches. The prescribed Catalyst regression command can provide behavioral regression evidence but cannot by itself prove the complete property truth table.

Verdict: NEEDS_DISCUSSION

Confidence: low

Summary: The submitted fix is minimal and logically sound, with no actionable code finding. Confidence remains low because the Gate was skipped and the two property-evaluation branches lack focused empirical coverage; the reviewer recommends retaining the implementation and running the single prescribed targeted validation before comparison.


🛠️ Try-Fix — Analysis & Comparison

Try-Fix Aggregate (PR #39032)

Candidate 1

Approach

Runtime-selection-gated UseInterpreter default for iOS/MacCatalyst: keep existing Debug default for android/windows/tizen, and set iOS/MacCatalyst UseInterpreter=True only when UseMonoRuntime == true.

Prior approach avoided

Avoided the current PR mechanism (VersionLessThan($(TargetFrameworkVersion), 11.0)) and the earlier regressed approach that removed iOS/MacCatalyst unconditionally.

Mechanism-level difference

This candidate is not a TFM-version split. It gates on resolved runtime mode (UseMonoRuntime) from Apple SDK evaluation. Mono-selected builds keep pre-.NET 11 interpreter default behavior; CoreCLR-selected builds do not set UseInterpreter, preventing the CoreCLR warning.

Files changed

  • src/Controls/src/Build.Tasks/nuget/buildTransitive/netstandard2.0/Microsoft.Maui.Controls.Common.targets

Exact diff (candidate)

diff --git a/src/Controls/src/Build.Tasks/nuget/buildTransitive/netstandard2.0/Microsoft.Maui.Controls.Common.targets b/src/Controls/src/Build.Tasks/nuget/buildTransitive/netstandard2.0/Microsoft.Maui.Controls.Common.targets
index 9576f9309f..a4fe272977 100644
--- a/src/Controls/src/Build.Tasks/nuget/buildTransitive/netstandard2.0/Microsoft.Maui.Controls.Common.targets
+++ b/src/Controls/src/Build.Tasks/nuget/buildTransitive/netstandard2.0/Microsoft.Maui.Controls.Common.targets
@@ -3,12 +3,13 @@
 	<PropertyGroup>
 		<_IsHotRestartDefined>$([System.Text.RegularExpressions.Regex]::IsMatch('$(DefineConstants.Trim())', '(^|;)HOTRESTART($|;)'))</_IsHotRestartDefined>
 		<DefineConstants Condition="!$(_IsHotRestartDefined) And '$(IsHotRestartBuild)' == 'true'">HOTRESTART;$(DefineConstants)</DefineConstants>
-    <UseInterpreter Condition="'$(UseInterpreter)' == '' and '$(Configuration)' == 'Debug' and 
-    ('$([MSBuild]::GetTargetPlatformIdentifier($(TargetFramework)))' == 'android' or 
-    '$([MSBuild]::GetTargetPlatformIdentifier($(TargetFramework)))' == 'ios' or 
-    '$([MSBuild]::GetTargetPlatformIdentifier($(TargetFramework)))' == 'maccatalyst' or 
-    '$([MSBuild]::GetTargetPlatformIdentifier($(TargetFramework)))' == 'windows' or 
+    <UseInterpreter Condition="'$(UseInterpreter)' == '' and '$(Configuration)' == 'Debug' and
+    ('$([MSBuild]::GetTargetPlatformIdentifier($(TargetFramework)))' == 'android' or
+    '$([MSBuild]::GetTargetPlatformIdentifier($(TargetFramework)))' == 'windows' or
     '$([MSBuild]::GetTargetPlatformIdentifier($(TargetFramework)))' == 'tizen')">True</UseInterpreter>
+    <UseInterpreter Condition="'$(UseInterpreter)' == '' and '$(Configuration)' == 'Debug' and '$(UseMonoRuntime)' == 'true' and
+    ('$([MSBuild]::GetTargetPlatformIdentifier($(TargetFramework)))' == 'ios' or
+    '$([MSBuild]::GetTargetPlatformIdentifier($(TargetFramework)))' == 'maccatalyst')">True</UseInterpreter>
   </PropertyGroup>

Test command (exact)

pwsh .github/scripts/BuildAndRunHostApp.ps1 -Platform catalyst -TestFilter "TestCategory=Button|TestCategory=Label|TestCategory=Layout"

Result

Blocked (environment blocker)

Test output summary

  • Repeated host-environment failures:
    • Unable to crop the Mac screenshot; preserving the full screenshot instead... outside screenshot bounds
    • VisualTestFailedException: Snapshot different than baseline ... size differs (baseline 789x563, actual 2560x1571)
  • These failures dominated the run and prevented clear behavioral signal for the UseInterpreter property-conditioning change.

Failure analysis

The candidate only changed build-time MSBuild property conditions. The observed failures were visual screenshot geometry/baseline mismatches in the host test environment, not deterministic evidence against the candidate logic itself. Per hard bounds, this attempt is recorded as Blocked and reported.

Inline self-review

  • Findings count: 0
  • reviewer-findings.json: []

Restore result

  • pwsh .github/scripts/EstablishBrokenBaseline.ps1 -Restore returned Restored True.

Candidate 2

Approach

No sound third discriminator within the baseline allow-list. No production change was attempted. The sole allow-listed file is an evaluation-time MSBuild target, and the required truth table differs only by Apple runtime generation: Debug iOS/Mac Catalyst must default UseInterpreter=True on the pre-.NET 11 Mono path, while the .NET 11 CoreCLR path must leave it unset.

Prior approaches avoided

  1. The current PR removes iOS/Mac Catalyst from the general Debug list and restores their assignment only when $([MSBuild]::VersionLessThan($(TargetFrameworkVersion), 11.0)).
  2. Candidate 1 assigns the Apple default only when $(UseMonoRuntime) == 'true'; its Catalyst test was Blocked by screenshot crop and baseline-dimension mismatches.
  3. The earlier PR revision removed iOS/Mac Catalyst for every TFM, regressing the required pre-.NET 11 Mono Debug default.

This candidate also rejected renamed equivalents: TFM strings, SDK/workload versions, runtime-flavor/CoreCLR/capability aliases, warning suppression, forwarding an interpreter switch through a legacy property, and reliance on an undocumented SDK default.

Mechanism-level distinction

This is a pre-test Blocked candidate, not rearranged syntax for either prior gate. In the allowed property group, Configuration, target platform, and initially empty UseInterpreter are identical in both required cases. A TFM, SDK, or workload boundary repeats version inference and can misclassify cross-targeting. A CoreCLR, Mono, runtime-flavor, or interpreter-capability signal repeats runtime-mode gating. Removing or indirectly bypassing UseInterpreter fails to preserve MAUI's pre-.NET 11 default; suppressing its warning only hides the symptom. A genuinely distinct mechanism would require the Apple SDK to own the default or expose a new contract, which requires a file outside RevertedFiles.

Baseline boundary

  • RevertedFiles: src/Controls/src/Build.Tasks/nuget/buildTransitive/netstandard2.0/Microsoft.Maui.Controls.Common.targets
  • NewFiles: empty
  • Out-of-allow-list generated drift: none

Files changed

  • Production files: none
  • Candidate artifacts: CustomAgentLogsTmp/PRState/39032/PRAgent/try-fix/attempt-2/

Exact diff

Test command (exact)

pwsh .github/scripts/BuildAndRunHostApp.ps1 -Platform catalyst -TestFilter "TestCategory=Button|TestCategory=Label|TestCategory=Layout"

Test result

Not run — Blocked before implementation. With no sound distinct implementation and an empty candidate diff, running the broad Catalyst regression set would provide no candidate signal and was explicitly prohibited as a meaningless test.

Failure analysis

This is an allow-list/design blocker, not an environment or test failure. The two defensible discriminators available to this evaluation-time MAUI target are already represented by the current PR and candidate 1. Moving responsibility into Apple SDK capability/default ownership is outside the baseline modification boundary. No warning was suppressed, no unsupported interpreter switch was substituted, and candidate 1 was neither reopened nor modified.

Inline self-review

  • Findings count: 0
  • reviewer-findings.json: []
  • Reviewed the empty final diff against all eight overarching principles; always-active Logic and Correctness, Regression Prevention, and Complexity Reduction; and routed Build & MSBuild and Input and Path Correctness dimensions.

Required artifacts

  • CustomAgentLogsTmp/PRState/39032/PRAgent/try-fix/attempt-2/baseline.log
  • CustomAgentLogsTmp/PRState/39032/PRAgent/try-fix/attempt-2/approach.md
  • CustomAgentLogsTmp/PRState/39032/PRAgent/try-fix/attempt-2/reviewer-findings.json
  • CustomAgentLogsTmp/PRState/39032/PRAgent/try-fix/attempt-2/reviewer-findings.diff
  • CustomAgentLogsTmp/PRState/39032/PRAgent/try-fix/attempt-2/result.txt
  • CustomAgentLogsTmp/PRState/39032/PRAgent/try-fix/attempt-2/fix.diff
  • CustomAgentLogsTmp/PRState/39032/PRAgent/try-fix/attempt-2/test-output.log
  • CustomAgentLogsTmp/PRState/39032/PRAgent/try-fix/attempt-2/analysis.md

Restore result

The final exact command, pwsh .github/scripts/EstablishBrokenBaseline.ps1 -Restore, completed and reported Restored True for the sole reverted target.


🏁 Report — Final Recommendation

⚠️ Report / Final Recommendation did not produce output on this run.

The Copilot expert-review task ended before this phase was persisted, usually because the review-stage time budget expired or the CI agent encountered a transient authentication/runtime problem. Earlier completed sections remain valid, but this review is incomplete without this phase.

Next step: re-comment /review to retry on a fresh agent. If this repeats across runs, a maintainer should inspect the reviewer token and Task 3 logs.


📱 UI Tests — Button,Label,Layout

Detected UI test categories: Button,Label,Layout

[!WARNING]
No UI test results were produced for the detected categories. The trusted gate was
skipped before build/test verification, so it does not prove that the PR build is healthy.
The deep UI stage also returned no results; inspect the independent CI checks and retry the
review if those categories still need coverage.


🧭 Next Steps — review latest findings

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

@MauiBot MauiBot added s/agent-review-incomplete AI review did not complete all expected phases and removed s/agent-changes-requested AI agent recommends changes - found a better alternative or issues s/agent-fix-win AI found a better alternative fix than the PR s/agent-review-in-progress AI review is currently running for this PR labels Oct 1, 2026
kubaflo added a commit that referenced this pull request Oct 8, 2026
…on (refs #39223) (#39242)

> [!WARNING]
> **Threat Detection Engine Failure** — The analysis engine could not
complete. This is a tooling failure, not a security finding.
> <!-- gh-aw-threat-engine-error -->
>
> <details>
> <summary>What happened</summary>
>
> The threat detection results could not be parsed.
>
> Review the [workflow run
logs](https://github.com/dotnet/maui/actions/runs/37711508022) for
details.
> </details>


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

Workflow artifact: ci-fix
Artifact kind: help
Refs: #39223
Target branch: net11.0
Attempt: 1/10


## Attempt 1 of 10

Derive the interpreter version check from the target framework and
evaluate it only for Apple target frameworks.

### Previous attempts (prior commits on this PR)

None; this is the first attempt for this tracking issue.

This attempt differs by: correcting the evaluation inputs and condition
ordering, rather than reverting the .NET 11 interpreter policy or merely
suppressing evaluation when an SDK property is missing.

## Root cause


`src/Controls/src/Build.Tasks/nuget/buildTransitive/netstandard2.0/Microsoft.Maui.Controls.Common.targets`
is copied into `.buildtasks` and imported by consumers. Its Debug
interpreter condition calls `VersionLessThan` on
`TargetFrameworkVersion` before checking the platform. That property can
still be empty during import, including cross-targeting evaluation.

The latest completed `maui-pr` build, 1626245, fails on both Windows and
macOS with `MSB4184` evaluating `VersionLessThan('', 11.0)`. The
condition was introduced by #39032. Importing the unchanged target into
an SDK-free MSBuild project reproduces the same diagnostic locally.

## Fix

Check for iOS or Mac Catalyst before performing the version comparison,
and obtain the framework version directly from `TargetFramework` with
MSBuild's `GetTargetFrameworkVersion`.

This preserves automatic interpreter selection for pre-.NET 11 Apple
Debug targets, leaves .NET 11 Apple targets unchanged, preserves
explicit `UseInterpreter` values, and leaves the existing
Android/Windows/Tizen Mono condition untouched. Empty outer-build target
frameworks do not enter the Apple version comparison.

No test, assertion, timeout, exclusion, analyzer setting, or public API
is changed.

## What is unverified / where I need help

- The affected project could not build locally because the required
Arcade SDK package could not be downloaded under the runner's network
restrictions. The runner has .NET 10 SDKs, not the repository's
requested .NET 11 SDK.
- Solution formatting was attempted with `--no-restore` but did not
complete within the bounded wait and was canceled. This patch changes
only an MSBuild condition, not C# formatting.
- Please confirm the automatically queued `maui-pr` Windows and macOS
builds clear MSB4184 and preserve the intended interpreter defaults in
real SDK imports.

## Validation

- Command: `pwsh /tmp/gh-aw/agent/validate-controls.ps1`
- Result: passed 19 isolated MSBuild evaluation cases against the actual
changed target using the installed .NET 10 SDK. Cases cover empty
outer-build TFM, .NET 9/10/11 Apple TFMs (including platform versions),
non-Apple TFMs, Mono defaults, Release configuration, explicit
interpreter values, and populated or empty `TargetFrameworkVersion`.
- Baseline command: `dotnet msbuild eval-controls.proj -t:Validate
-p:TargetFramework=net11.0-ios -p:ExpectedUseInterpreter= -v:minimal
-nologo`, from the temporary validation directory. The unchanged target
fails with the original MSB4184 diagnostic.
- Command: `dotnet build
src/Controls/src/Build.Tasks/Controls.Build.Tasks.csproj --no-restore
-v:minimal -nologo`
- Result: not validated; blocked before compilation by Arcade SDK
resolution (MSB4236).
- Command: `git diff --check`
- Result: passed.

## Evidence

- Original failing build:
https://dev.azure.com/dnceng-public/public/_build/results?buildId=1626241
- Latest verified-failing build:
https://dev.azure.com/dnceng-public/public/_build/results?buildId=1626245
- Latest Windows build log:
https://dev.azure.com/dnceng-public/public/_apis/build/builds/1626245/logs/114?api-version=7.1
- Latest macOS build log:
https://dev.azure.com/dnceng-public/public/_apis/build/builds/1626245/logs/179?api-version=7.1

---
Filed by
[`ci-status-fix-net11`](https://github.com/dotnet/maui/blob/main/.github/workflows/ci-status-fix-net11.md).
This is the single PR for #39223: the workflow watches its
own CI and pushes up to **10 attempts on this same PR** (it never opens
a second PR). It advances only when the fix's own build settles red and
that red is caused by the fix. Comments, reviews, and commits do not
transfer ownership; the loop remains autonomous until this PR is closed.
Eligible `CHANGES_REQUESTED` reviews are handled through Track C. After
10 attempts it stops and defers to humans. The trusted CI-fix validator
automatically queues maui-pr, uitests, and devicetests for every new PR
head.

> [!WARNING]
> <details>
> <summary>Firewall blocked 2 domains</summary>
>
> The following domains were blocked by the firewall during workflow
execution:
>
> - `ajhvsblobprodcus363.vsblob.vsassets.io`
> - `dc.services.visualstudio.com`
>
> To allow these domains, add them to the `network.allowed` list in your
workflow frontmatter:
>
> ```yaml
> network:
>   allowed:
>     - defaults
>     - "ajhvsblobprodcus363.vsblob.vsassets.io"
>     - "dc.services.visualstudio.com"
> ```
>
> See [Network
Configuration](https://github.github.com/gh-aw/reference/network/) for
more information.
>
> </details>

> Generated by [CI Failure Fixer
(net11.0)](https://github.com/dotnet/maui/actions/runs/37711508022) · ⊞
29.2K ·
[◷](https://github.com/search?q=repo%3Adotnet%2Fmaui+%22gh-aw-workflow-id%3A+ci-status-fix-net11%22&type=pullrequests)

<!-- gh-aw-agentic-workflow: CI Failure Fixer (net11.0), engine:
copilot, model: gpt-6.1-sol, id: 37711508022, workflow_id:
ci-status-fix-net11, run:
https://github.com/dotnet/maui/actions/runs/37711508022 -->

<!-- gh-aw-workflow-id: ci-status-fix-net11 -->
<!-- gh-aw-workflow-call-id: dotnet/maui/ci-status-fix-net11 -->

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 1, 2026
@github-actions github-actions Bot modified the milestones: .NET 11.0-rc2, .NET 11.0 GA Nov 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-tooling XAML & C# Hot Reload, XAML Editor, Live Visual Tree, Live Preview, Debugging s/agent-review-incomplete AI review did not complete all expected phases 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.

5 participants