The following Trim warnings are geneated when trying to use the CommunityToolkit with NativeAOT in .net 9 Maui on iOS:
ILC : Trim analysis warning IL2092: CommunityToolkit.Maui.Converters.ICommunityToolkitValueConverter.Microsoft.Maui.Controls.IValueConverter.Convert(Object,Type,Object,CultureInfo): 'DynamicallyAccessedMemberTypes' in 'DynamicallyAccessedMembersAttribute' on the parameter '' of method 'CommunityToolkit.Maui.Converters.ICommunityToolkitValueConverter.Microsoft.Maui.Controls.IValueConverter.Convert(Object,Type,Object,CultureInfo)' don't match overridden parameter '' of method 'Microsoft.Maui.Controls.IValueConverter.Convert(Object,Type,Object,CultureInfo)'. All overridden members must have the same 'DynamicallyAccessedMembersAttribute' usage.
ILC : Trim analysis warning IL2092: CommunityToolkit.Maui.Converters.ICommunityToolkitValueConverter.Microsoft.Maui.Controls.IValueConverter.ConvertBack(Object,Type,Object,CultureInfo): 'DynamicallyAccessedMemberTypes' in 'DynamicallyAccessedMembersAttribute' on the parameter '' of method 'CommunityToolkit.Maui.Converters.ICommunityToolkitValueConverter.Microsoft.Maui.Controls.IValueConverter.ConvertBack(Object,Type,Object,CultureInfo)' don't match overridden parameter '' of method 'Microsoft.Maui.Controls.IValueConverter.ConvertBack(Object,Type,Object,CultureInfo)'. All overridden members must have the same 'DynamicallyAccessedMembersAttribute' usage.
ILC : Trim analysis warning IL2092: CommunityToolkit.Maui.Converters.ICommunityToolkitValueConverter.Microsoft.Maui.Controls.IValueConverter.Convert(Object,Type,Object,CultureInfo): 'DynamicallyAccessedMemberTypes' in 'DynamicallyAccessedMembersAttribute' on the parameter '' of method 'CommunityToolkit.Maui.Converters.ICommunityToolkitValueConverter.Microsoft.Maui.Controls.IValueConverter.Convert(Object,Type,Object,CultureInfo)' don't match overridden parameter '' of method 'Microsoft.Maui.Controls.IValueConverter.Convert(Object,Type,Object,CultureInfo)'. All overridden members must have the same 'DynamicallyAccessedMembersAttribute' usage.
ILC : Trim analysis warning IL2092: CommunityToolkit.Maui.Converters.ICommunityToolkitValueConverter.Microsoft.Maui.Controls.IValueConverter.ConvertBack(Object,Type,Object,CultureInfo): 'DynamicallyAccessedMemberTypes' in 'DynamicallyAccessedMembersAttribute' on the parameter '' of method 'CommunityToolkit.Maui.Converters.ICommunityToolkitValueConverter.Microsoft.Maui.Controls.IValueConverter.ConvertBack(Object,Type,Object,CultureInfo)' don't match overridden parameter '' of method 'Microsoft.Maui.Controls.IValueConverter.ConvertBack(Object,Type,Object,CultureInfo)'. All overridden members must have the same 'DynamicallyAccessedMembersAttribute' usage.
/_/src/CommunityToolkit.Maui/Extensions/ValueConverterExtension.shared.cs(31): Trim analysis warning IL2062: CommunityToolkit.Maui.Extensions.ValueConverterExtension.IsValidTargetType<TTarget>(Type&,Boolean): Value passed to parameter 'type' of method 'System.Activator.CreateInstance(Type)' can not be statically determined and may not meet 'DynamicallyAccessedMembersAttribute' requirements.
<IsAotCompatible>true</IsAotCompatible>
<PublishAot Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">true</PublishAot>
- .NET MAUI CommunityToolkit: 10.0.0
- OS: iOS
- .NET MAUI: 9.0.21
Is there an existing issue for this?
Did you read the "Reporting a bug" section on Contributing file?
Current Behavior
The following Trim warnings are geneated when trying to use the CommunityToolkit with NativeAOT in .net 9 Maui on iOS:
Expected Behavior
No Trim warnings
Reproduction Sample
https://github.com/trampster/MauiCommunityToolkitTrimIssue
Steps To Reproduce
<PackageReference Include="CommunityToolkit.Maui" Version="10.0.0" />dotnet publish -f net9.0-ios -r ios-arm64-> trim warnings from description
Link to public reproduction project repository
MauiCommunityToolkitTrimIssue
Environment
Anything else?
No response