-
Notifications
You must be signed in to change notification settings - Fork 5k
[mobile] Add extra HttpClientHandler linker substitution #64818
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The linker substitution for HttpClientHandler.IsNativeHandlerEnabled only worked when <UseNativeHttpHandler> in a project was set to false. Since the default for MAUI projects is true, this caused us to carry more assemblies than needed. Fixes dotnet#64361
Tagging subscribers to this area: @dotnet/ncl Issue DetailsThe linker substitution for HttpClientHandler.IsNativeHandlerEnabled only worked when in a project was set to false. Since the default for MAUI projects is true, this caused us to carry more assemblies than needed. Fixes #64361
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any way we can add a test for this? Maybe adding a https://github.com/dotnet/runtime/tree/main/src/libraries/System.Net.Http/tests/TrimmingTests ?
You can set feature switches in the trimming test following this pattern:
runtime/src/libraries/System.Runtime/tests/TrimmingTests/System.Runtime.TrimmingTests.proj
Lines 18 to 20 in 02ac5c3
<TestConsoleAppSourceFiles Include="InvariantGlobalizationTrue.cs"> | |
<EnabledFeatureSwitches>System.Globalization.Invariant;System.Globalization.PredefinedCulturesOnly</EnabledFeatureSwitches> | |
</TestConsoleAppSourceFiles> |
src/libraries/System.Net.Http/src/ILLink/ILLink.Substitutions.mobile.xml
Outdated
Show resolved
Hide resolved
Tagging subscribers to 'size-reduction': @eerhardt, @SamMonoRT, @marek-safar Issue DetailsThe linker substitution for HttpClientHandler.IsNativeHandlerEnabled only worked when in a project was set to false. Since the default for MAUI projects is true, this caused us to carry more assemblies than needed. Fixes #64361
|
…mobile.xml Co-authored-by: Eric Erhardt <[email protected]>
Tagging subscribers to 'linkable-framework': @eerhardt, @vitek-karas, @LakshanF, @sbomer, @joperezr Issue DetailsThe linker substitution for HttpClientHandler.IsNativeHandlerEnabled only worked when in a project was set to false. Since the default for MAUI projects is true, this caused us to carry more assemblies than needed. Fixes #64361
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM. Thanks for getting this fixed! It should really help app size in Maui.
Rethinking the trimming test - it isn't currently possible to write the test I mention above because we don't run the trimming tests on android or ios. See #39274
/backport to release/6.0 |
Started backporting to release/6.0: https://github.com/dotnet/runtime/actions/runs/1800182990 |
The linker substitution for HttpClientHandler.IsNativeHandlerEnabled only worked when in a project was set to false. Since the default for MAUI projects is true, this caused us to carry more assemblies than needed.
Fixes #64361