Skip to content

[ci-scan-net11] AOT integration tests fail with "Unexpected warning files: ILC" for HybridWebViewHandler on iOS/macCatalyst (net11.0) #35745

Description

@github-actions

Summary

AOTTemplateTest.PublishNativeAOTRootAllMauiAssemblies and AOTTemplateTest.PublishNativeAOT integration tests fail on iOS and macCatalyst because the ILC (Native AOT compiler) generates unexpected IL3050 warning files for HybridWebViewHandler.WebViewScriptMessageHandler and SchemeHandler, which are not in the expected warnings baseline.

Build Information

  • Pipeline: maui-pr (ID 302)
  • Build: 1446270 (latest)
  • Branch: net11.0
  • First seen: 2026-05-13 (build 1413742)
  • Occurrences: 12 in last 15 builds

Affected Legs

  • AOT macOS — net11.0-maccatalyst maccatalyst-arm64
  • AOT macOS — net11.0-maccatalyst maccatalyst-x64
  • AOT macOS — net11.0-ios iossimulator-x64
  • AOT macOS — net11.0-ios iossimulator-arm64
  • AOT macOS — net11.0-ios ios-arm64

Error Message

[xUnit.net] Microsoft.Maui.IntegrationTests.AOTTemplateTest.PublishNativeAOTRootAllMauiAssemblies
    (id: "maui", framework: "net11.0-maccatalyst", runtimeIdentifier: "maccatalyst-arm64") [FAIL]

Error Message:
 Unexpected warning files detected! Unexpected warning file paths are: ILC

ILC : AOT analysis warning IL3050: <Module>..cctor(): Using member
'Microsoft.Maui.Handlers.HybridWebViewHandler.WebViewScriptMessageHandler..cctor()'
which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling.
HybridWebView uses dynamic System.Text.Json serialization features.

ILC : AOT analysis warning IL3050: <Module>..cctor(): Using member
'Microsoft.Maui.Handlers.HybridWebViewHandler.SchemeHandler..cctor()'
which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling.
HybridWebView uses dynamic System.Text.Json serialization features.

Also failing with unexpected apply-preserve-attribute.xml linker-cache file:

Unexpected warning files detected! Unexpected warning file paths are:
  obj/Release/net11.0-maccatalyst/maccatalyst-arm64/linker-cache/apply-preserve-attribute.xml

Recommended Action

The inner types WebViewScriptMessageHandler and SchemeHandler inside HybridWebViewHandler (iOS/macCatalyst platform code under src/Core/src/Handlers/HybridWebView/) carry [RequiresDynamicCode] because they use dynamic System.Text.Json serialization. Their static constructors are reached unconditionally by the ILC, producing unexpected IL3050 warning files that are not in the AOT test baseline.

Options:

  1. Preferred: Migrate HybridWebViewHandler JSON serialization to source-generated System.Text.Json to remove the [RequiresDynamicCode] attribute entirely
  2. Add the new ILC warning files to the AOT test expected-warnings baseline as a short-term workaround

Related: issue #34867 (same root cause on Android variant)

Generated by CI Failure Scanner (net11.0) · ● 51M ·

Metadata

Metadata

Assignees

No one assigned

    Labels

    ci-scan-net11CI scanner findings for net11.0

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions