Skip to content

Multiple IL2037 warnings when publishing Maui app with PublishAot=true #26969

Closed

Description

@mjo151

Apple platform

iOS

Framework version

net10.0-*

Affected platform version

.NET 10.0.402

Description

Multiple IL2037 warnings occur when publishing a .NET Maui app with PublishAot set to true. I am using .NET 10.0.402 with iOS workload version 27.1.10018 and Xcode 27.1. I noticed the warnings when building my app and reproduced with a new Maui app.

`ILLink : warning IL2037: ..cctor(): No members were resolved for 'Microsoft.Maui.Platform.IUIViewLifeCycleEvents.MovedToWindow' on type 'Microsoft.Maui.Platform.MauiSearchBar'.

ILLink : warning IL2037: ..cctor(): No members were resolved for 'Microsoft.Maui.IPlatformApplication.Application' on type 'Microsoft.Maui.MauiUIApplicationDelegate'.

ILLink : warning IL2037: ..cctor(): No members were resolved for 'Microsoft.Maui.Platform.IUIViewLifeCycleEvents.MovedToWindow' on type 'Microsoft.Maui.Platform.MauiActivityIndicator'.

ILLink : warning IL2037: ..cctor(): No members were resolved for 'Microsoft.Maui.ICrossPlatformLayoutBacking.CrossPlatformLayout' on type 'Microsoft.Maui.Platform.MauiScrollView'.

ILLink : warning IL2037: ..cctor(): No members were resolved for 'Microsoft.Maui.Platform.IUIViewLifeCycleEvents.MovedToWindow' on type 'Microsoft.Maui.Platform.MauiPageControl'.

(truncated)`

Steps to Reproduce

  1. dotnet new maui
  2. Set PublishAot to true in the project file
  3. dotnet publish -f net10.0-ios -c Release

Did you find any workaround?

I have not found a workaround.

Build logs

No response

Activity

  1. rolfbjarne commented on Oct 22, 2026

    @rolfbjarne
    Member

    Thanks for the report!

    We're already fixed this, but the fix wasn't backported to the release branch. We'll do that, and this will be fixed in the next .NET 10 release.

  2. added
    bug
    regression
    on Oct 22, 2026
  3. added this to the Future milestone on Oct 22, 2026
  4. mjo151 commented on Oct 22, 2026

    @mjo151
    Author
    1. Thanks for the report!
      We're already fixed this, but the fix wasn't backported to the release branch. We'll do that, and this will be fixed in the next .NET 10 release.

    Thanks for the quick reply. Are these real warnings that could problems or just false positives?

  5. rolfbjarne commented on Oct 22, 2026

    @rolfbjarne
    Member
    1. Thanks for the report!
      We're already fixed this, but the fix wasn't backported to the release branch. We'll do that, and this will be fixed in the next .NET 10 release.

    Thanks for the quick reply. Are these real warnings that could problems or just false positives?

    Possibly. The problem is that build might end up trimming away some properties and events that shouldn't be trimmed away.

    However, since this is limited to properties and events that implement interface members explicitly (not methods, nor any member for any other reason) + this would only cause problems if no other code already references these members (because then they wouldn't be trimmed away anyway), I would think it's unlikely there will be problems. That said, it's not impossible, so please test the NativeAOT build to make sure it continues to work.

  6. charlesroddie commented on Nov 11, 2026

    @charlesroddie

    The fix isn't in the dotnet11 release. Hopefully the next one!

  7. rolfbjarne commented on Nov 11, 2026

    @rolfbjarne
    Member

    @charlesroddie

    The fix isn't in the dotnet11 release. Hopefully the next one!

    As far as I can tell it is in the .NET 11 release.

    I'm wondering whether you're running into a separate issue somehow; could you get an MSBuild binlog for a build that shows these warnings?

  8. charlesroddie commented on Nov 11, 2026

    @charlesroddie

    Ah you are right, sorry. Getting a similar but different problem and opening a new issue for it.

  9. rolfbjarne commented on Nov 11, 2026

    @rolfbjarne
    Member

    Ok, I'll close this issue then since it's fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugregression

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions