Skip to content

Error when MonoAOT is enabled with CoreCLR#11246

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/fix-aot-build-failure
Draft

Error when MonoAOT is enabled with CoreCLR#11246
Copilot wants to merge 3 commits intomainfrom
copilot/fix-aot-build-failure

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 29, 2026

RunAOTCompilation=true was still enabling MonoAOT for CoreCLR builds, causing mono-aot-cross to fail later with a runtime-critical type error. CoreCLR builds should reject this configuration early with an actionable MSBuild error.

  • Runtime property validation

    • Detect RunAOTCompilation=true when the selected Android runtime is not MonoVM.
    • Preserve existing EnableLLVM non-Mono behavior as a warning/ignore path.
  • MSBuild error

    • Add XA1045 for incompatible MonoAOT/runtime combinations:
      MonoAOT is not compatible with the CoreCLR runtime. Remove the 'RunAOTCompilation' MSBuild property from your project configuration.
      
  • Test coverage

    • Update the CoreCLR AOT test to expect a build failure with XA1045 instead of a successful build with XA1044.

Copilot AI and others added 2 commits April 29, 2026 12:50
Agent-Logs-Url: https://github.com/dotnet/android/sessions/5dc84843-14bd-46ed-a820-7463318a90bb

Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>
Agent-Logs-Url: https://github.com/dotnet/android/sessions/5dc84843-14bd-46ed-a820-7463318a90bb

Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix build failure with AOT enabled in .NET 11 preview Error when MonoAOT is enabled with CoreCLR Apr 29, 2026
Copilot AI requested a review from simonrozsival April 29, 2026 13:00
Copy link
Copy Markdown
Member

@simonrozsival simonrozsival left a comment

Choose a reason for hiding this comment

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

@copilot let's keep the existing codes, but only change the warnings to errors.

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.

Runtime critical type System.Diagnostics.MonoStackFrame: during AOT

2 participants