-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Open
Description
Description
For the property:
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)]
Type? IHybridWebView.InvokeJavaScriptType { get; set; }We got the trimmer warning:
ILC: IL2114: Microsoft.Maui.Controls.HybridWebView.<Microsoft.Maui.IHybridWebView.InvokeJavaScriptType>k__BackingField: 'DynamicallyAccessedMembersAttribute' on 'Microsoft.Maui.Controls.HybridWebView' or one of its base typesThis was inside a .NET MAUI project on iOS.
We think something like this will workaround this case, but CI is ongoing:
Reproduction Steps
-
dotnet new maui -
Root everything:
<ItemGroup>
<PackageReference Include="Microsoft.Maui.Controls.Foldable" Version="$(MauiVersion)" />
<PackageReference Include="Microsoft.Maui.Controls.Maps" Version="$(MauiVersion)" />
<PackageReference Include="Microsoft.Maui.Graphics.Skia" Version="$(MauiVersion)" />
</ItemGroup>
<ItemGroup>
<TrimmerRootAssembly Include="Microsoft.Maui" RootMode="All" />
<TrimmerRootAssembly Include="Microsoft.Maui.Controls" RootMode="All" />
<TrimmerRootAssembly Include="Microsoft.Maui.Controls.Foldable" RootMode="All" />
<TrimmerRootAssembly Include="Microsoft.Maui.Controls.Maps" RootMode="All" />
<TrimmerRootAssembly Include="Microsoft.Maui.Controls.Xaml" RootMode="All" />
<TrimmerRootAssembly Include="Microsoft.Maui.Essentials" RootMode="All" />
<TrimmerRootAssembly Include="Microsoft.Maui.Graphics" RootMode="All" />
<TrimmerRootAssembly Include="Microsoft.Maui.Graphics.Skia" RootMode="All" />
<TrimmerRootAssembly Include="Microsoft.Maui.Maps" RootMode="All" />
</ItemGroup>- Publish for NativeAOT:
dotnet publish -c Release -p:PublishAot=true -f net9.0-ios
Expected behavior
We would not get trimmer warnings for k__BackingField.
Actual behavior
We get trimmer warnings for k__BackingField.
Regression?
Not sure
Known Workarounds
I assume we can do:
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)]
private Type? _invokeJavaScriptType;
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)]
Type? IHybridWebView.InvokeJavaScriptType
{
get => _invokeJavaScriptType;
set => _invokeJavaScriptType = value;
}Configuration
> dotnet --version
9.0.100-rc.2.24426.11
Other information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
No status