-
Notifications
You must be signed in to change notification settings - Fork 349
Closed
Description
When using MySqlStringConnectionBuilder together with options binding source generation it's possible to hit warnings like:
/_/src/MySqlConnector/MySqlConnectionStringBuilder.cs(879,3): Trim analysis error IL2112: MySqlConnector.MySqlConnectionStringBuilder.GetProperties(Hashtable): 'DynamicallyAccessedMembersAttribute' on 'MySqlConnector.MySqlConnectionStringBuilder' or one of its base types references 'MySqlConnector.MySqlConnectionStringBuilder.GetProperties(Hashtable)' which requires unreferenced code. PropertyDescriptor's PropertyType cannot be statically discovered.
This came up in microsoft/mcp#1112.
dotnet/runtime#121718 describes the root cause for this warning. For now the best fix is to suppress the IL2112 on MySqlConnectionStringBuilder.GetProperties.
This should have been caught when adding the native aot test app. The test app should follow the recommendations in https://learn.microsoft.com/dotnet/core/deploying/trimming/prepare-libraries-for-trimming#show-all-warnings-with-test-app and set TrimmerRootAssembly.
Metadata
Metadata
Assignees
Labels
No labels