Skip to content

[TrimmableTypeMap] Address all trimming and AOT warnings #10794

Closed

Description

@simonrozsival

Part of #10788

  • All classes supporting "native llvm ir" typemaps, marshal methods, and reflection-based "register native methods" are trimmed out
  • No [UnconditionalSuppressMessage] used in the dotnet/android repo
  • No [UnconditionalSuppressMessage] used in the dotnet/java-interop repo
  • No trimming or AOT warnings when building Mono.Android
  • No trimming or AOT warnings when building .NET MAUI apps

Activity

  1. added this to the .NET 11 milestone on Feb 10, 2026
  2. added
    needs-triage
    Area: NativeAOT
    Area: CoreCLR
    on Feb 10, 2026
  3. simonrozsival commented on Mar 18, 2026

    @simonrozsival
    MemberAuthor

    From the trimmable typemap runtime PR: we added several [DynamicallyAccessedMembers] annotations that should be revisited and removed where possible:

    • JavaPeerContainerFactory<T> — the DAM on T preserves all constructor metadata on every type in the typemap. We should investigate removing DAM from JavaDictionary<K,V>, JavaList<T>, JavaCollection<T> type parameters instead.
    • JavaPeerProxy<T>.InvokerType — DAM on the property return type; should be removable once invoker types are preserved by the trimmer step.
    • JavaPeerContainerFactory.CreateHigherRankArray — uses MakeArrayType() at runtime for rank 4+; may cause NativeAOT code bloat.

    General goal: remove all unnecessary or incorrectly used [DynamicallyAccessedMembers] — especially those added alongside #pragma warning disable as workarounds.

  4. locked and limited conversation to collaborators on Sep 19, 2026
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

    Area: CoreCLRArea: NativeAOTneeds-triagetrimmable-type-map

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions