[release/8.0] [iOS] Fix trimming warnings in HttpClientHandler.AnyMobile #91877
+112
−375
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport of #91520 to release/8.0
/cc @simonrozsival
Customer Impact
The code in HttpClientHandler.AnyMobile.cs produces an unactionable trimming warning when compiled with ILC. Since we are shipping NativeAOT support for iOS in .NET 8, any time customers would use
HttpClientHandler
in their apps, they would see these warnings in their build outputs.Testing
Manually tested with
xamarin/xamarin-macios
.NET 8 RC1.Risk
Low. This change is just refactoring of existing code but touches the logic that dynamically calls into Microsoft macOS/iOS/tvOS/Android and there aren't any CI tests that would catch any regressions before this change is consumed by the downstream repositories so the change can only be tested manually.