You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When setting $(EnableAotAnalyzer) to true, there are several warnings we will suppress for now. These will likely work under Mono, but will need to be fixed one day in .NET 10 or some future release that supports NativeAOT.
Ignoring AOT warnings like a reasonable place to start, so we can enable the analyzer and not introduce new warnings.
Creating an issue for now, so I can link to this issue from C# code comments.
Steps to Reproduce
Build Mono.Android.csproj with EnableAotAnalyzer=true.
We'll probably actually suppress the warnings like:
// FIXME: https://github.com/xamarin/xamarin-android/issues/8724// IL3050 disabled in source: if someone uses NativeAOT, they will get the warning.
#pragma warning disable IL3050vardynamic=newDynamicMethod(DynamicMethodNameCounter.GetUniqueName(),ret_type,param_types,typeof(DynamicMethodNameCounter),true);
#pragma warning restore IL3050
Closing as superseded. The original prerequisite work is captured and completed in #11860. Remaining NativeAOT implementation and validation work is tracked by the trimmable type map epic #10788, warning cleanup #10794 and #11012, and functional validation #10793.
Activity
[Mono.Android] fix trimming warnings, part 2
jonathanpeppers commentedon Feb 27, 2024
Update
We'll probably actually suppress the warnings like:
[-][NativeAOT] fix places we use `[UnconditionalSuppressMessage ("AOT")]`[/-][+]Fix known issues with NativeAOT[/+][Mono.Android] fix trimming warnings, part 2
[Mono.Android] fix trimming warnings, part 2 (#8758)
[Mono.Android] is now "trimming safe" (#8778)
[One .NET] "greenfield" projects opt into trimming
[One .NET] new "greenfield" projects are trimmed by default (#8805)
jonathanpeppers commentedon Jul 2, 2024
We will need to suppress warnings from the trimmer, but rely on warnings coming from the AOT compiler (ILC):
[NativeAOT] Make the trimmable typemap the default (#12121)
jonathanpeppers commentedon Aug 12, 2026
Closing as superseded. The original prerequisite work is captured and completed in #11860. Remaining NativeAOT implementation and validation work is tracked by the trimmable type map epic #10788, warning cleanup #10794 and #11012, and functional validation #10793.