Repository navigation
[Xamarin.Android.Build.Tasks] Reject legacy AOT disable on CoreCLR - #12956
Merged
Merged
Conversation
Setting RunAOTCompilation=false on CoreCLR silently leaves ReadyToRun compilation enabled. Reject the legacy setting with XA1044 and direct users to PublishReadyToRun=false starting with .NET 11. Capture explicitly enabled and disabled settings before resetting the unsupported Mono properties. Preserve the existing parameterized error for enabled properties and allow the disabled setting on NativeAOT. Expand configuration regression coverage and document the migration. Co-authored-by: Copilot App <[email protected]>
…ras-reject-legacy-aot-disable
vitek-karas
marked this pull request as ready for review
September 30, 2026 15:31
vitek-karas
requested review from
jonathanpeppers and
simonrozsival
as code owners
September 30, 2026 15:31
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The implementation and documentation are consistent, with only a minor additional NativeAOT regression-test suggestion.
Review effort: Balanced
Findings: 1
What changed in this PR
Rejects RunAOTCompilation=false for CoreCLR and directs .NET 11 users to PublishReadyToRun=false.
Changes:
- Adds an XA1044 variant for disabled legacy AOT.
- Preserves NativeAOT compatibility.
- Expands tests and documentation.
| File | Description |
|---|---|
Xamarin.Android.Common.targets |
Emits the new XA1044 diagnostic. |
InvalidConfigTests.cs |
Tests CoreCLR and NativeAOT configurations. |
Resources.resx |
Adds the localized error text. |
Resources.Designer.cs |
Adds the generated resource accessor. |
Microsoft.Android.Sdk.DefaultProperties.targets |
Captures enabled and disabled legacy settings. |
xa1044.md |
Documents the new diagnostic. |
build-properties.md |
Documents the .NET 11 migration. |
Files not reviewed (1)
- src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs: Generated file
jonathanpeppers
approved these changes
Sep 30, 2026
Member
|
After we get this merged, I can take care of the backport to |
Member
|
/backport to release/11.0.1xx |
Contributor
|
Started backporting to |
Contributor
|
@jonathanpeppers backporting to git am output$ git cherry-pick 82ecf397120de4108f8e6c34063c94f52146f9b4
Auto-merging Documentation/docs-mobile/building-apps/build-properties.md
CONFLICT (content): Merge conflict in Documentation/docs-mobile/building-apps/build-properties.md
Auto-merging Documentation/docs-mobile/messages/xa1044.md
CONFLICT (content): Merge conflict in Documentation/docs-mobile/messages/xa1044.md
Auto-merging src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.DefaultProperties.targets
CONFLICT (content): Merge conflict in src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.DefaultProperties.targets
Auto-merging src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs
Auto-merging src/Xamarin.Android.Build.Tasks/Properties/Resources.resx
Auto-merging src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/InvalidConfigTests.cs
CONFLICT (content): Merge conflict in src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/InvalidConfigTests.cs
Auto-merging src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets
error: could not apply 82ecf3971... [Xamarin.Android.Build.Tasks] Reject legacy AOT disable on CoreCLR (#12956)
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch
Applying: [Xamarin.Android.Build.Tasks] Reject legacy AOT disable on CoreCLR
Using index info to reconstruct a base tree...
M Documentation/docs-mobile/building-apps/build-properties.md
M Documentation/docs-mobile/messages/xa1044.md
M src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.DefaultProperties.targets
M src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs
M src/Xamarin.Android.Build.Tasks/Properties/Resources.resx
M src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/InvalidConfigTests.cs
M src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets
Falling back to patching base and 3-way merge...
Auto-merging Documentation/docs-mobile/building-apps/build-properties.md
CONFLICT (content): Merge conflict in Documentation/docs-mobile/building-apps/build-properties.md
Auto-merging Documentation/docs-mobile/messages/xa1044.md
CONFLICT (content): Merge conflict in Documentation/docs-mobile/messages/xa1044.md
Auto-merging src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.DefaultProperties.targets
CONFLICT (content): Merge conflict in src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.DefaultProperties.targets
Auto-merging src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs
Auto-merging src/Xamarin.Android.Build.Tasks/Properties/Resources.resx
Auto-merging src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/InvalidConfigTests.cs
CONFLICT (content): Merge conflict in src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/InvalidConfigTests.cs
Auto-merging src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0001 [Xamarin.Android.Build.Tasks] Reject legacy AOT disable on CoreCLR
Error: The process '/usr/bin/git' failed with exit code 128 |
jonathanpeppers
added a commit
that referenced
this pull request
Oct 1, 2026
* [Xamarin.Android.Build.Tasks] Reject legacy AOT disable on CoreCLR Backport #12956 to release/11.0.1xx, capturing the explicitly disabled setting before Mono AOT defaults are applied. Preserve Mono and NativeAOT behavior and update diagnostics, docs, and configuration tests. * [tests] Stop setting Mono AOT disable on CoreCLR fixtures CoreCLR test projects formerly set RunAOTCompilation=false through AotAssemblies and per-ABI test setup. With XA1044 rejecting that legacy property, these fixtures fail before reaching the behavior they test. Omit Mono AOT settings for CoreCLR, retaining intentional invalid-configuration coverage and existing ReadyToRun defaults. Co-authored-by: Copilot App <[email protected]>
jfversluis
pushed a commit
to dotnet/docs-mobile
that referenced
this pull request
Oct 2, 2026
Sync the merged dotnet/android#12956 guidance so CoreCLR users remove RunAOTCompilation=false and disable ReadyToRun with PublishReadyToRun=false instead. Preserve NativeAOT compatibility and supported .NET 10-and-earlier Mono guidance. Co-authored-by: Copilot App <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Setting
$(RunAOTCompilation)tofalseon CoreCLR silently leaves ReadyToRun compilation enabled. Starting with .NET 11, users must set$(PublishReadyToRun)tofalseinstead.Report XA1044 for the explicitly disabled legacy property with guidance for disabling ReadyToRun. Capture enabled and disabled settings before resetting unsupported Mono properties, preserving the existing parameterized diagnostic for enabled properties and allowing
RunAOTCompilation=falseon NativeAOT.Update the property and error documentation, and expand configuration tests for Debug/Release, enabled/disabled Mono AOT properties, ReadyToRun settings, and NativeAOT compatibility.
Validation: 108 MSBuild evaluations passed across runtime, configuration, AOT, LLVM, and ReadyToRun settings. XML/resource/documentation consistency checks and
git diff --checkpassed. Full-build integration tests were not run because the locally built Android SDK is unavailable.No linked issue.
Pull Request
title and
description
should follow the
commit-messages.mdworkflow documentation, and in particular should include: