NativeAOT publish fails when AsyncHelpers.RestoreInlinedFrameContexts is missing

Open
#12,486 1 comment 1 reaction 2 assignees View on GitHub

@simonrozsival is already working on this.

Since Aug 24, 2026.

  • #12489 by @copilot-swe-agent — closed without merging

Assessment

This issue has not been assessed yet.

Description

needs-triage
Description

MAUI Android NativeAOT publishing fails consistently because ILCompiler expects System.Runtime.CompilerServices.AsyncHelpers.RestoreInlinedFrameContexts, but the method is absent from the supplied System.Private.CoreLib.

The failure reproduces on both Pixel8 and GalaxyA16 legs in two consecutive dotnet/performance CI builds.

Error
ILCompiler.CodeGenerationFailedException: Code generation failed for method
'Async variant: [System.Private.CoreLib]System.IO.FileStream.DisposeAsync()'

System.InvalidOperationException: Expected method 'RestoreInlinedFrameContexts' not found on type
'[System.Private.CoreLib]System.Runtime.CompilerServices.AsyncHelpers'

The subsequent dotnet publish command exits with code 1 for net11.0-android, android-arm64, with:

/p:UseMonoRuntime=false
/p:PublishAot=true
Affected builds
Versions
  • Target framework: net11.0-android
  • Runtime identifier: android-arm64
  • Android workload: 37.0.0-rc.2.2294
  • ILCompiler/runtime package: 11.0.0-rc.2.26422.106
  • MAUI workload: 11.0.0-preview.7.26418.6
Dominant language
C#
Stars
2.1k
Forks
580
Avg merge
2d 19m
Merged PRs (30d)
228

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dotnet/android

All issues in dotnet/android

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.