From ae413d9a81ede4cd7c624d7ec7792c16ad8b8f21 Mon Sep 17 00:00:00 2001 From: Steve Pfister Date: Mon, 26 Jul 2021 21:40:32 -0400 Subject: [PATCH] Split mobile specific ILLink.Substitutions into its own file (#56306) It was discovered in #56161 that mobile specific HttpClientHandler substitutions were sticking around even for non mobile builds. This change moves the substitution into ILLink.Substitutions.mobile.xml. --- .../src/ILLink/ILLink.Substitutions.mobile.xml | 7 +++++++ .../src/ILLink/ILLink.Substitutions.xml | 3 --- .../System.Net.Http/src/System.Net.Http.csproj | 4 +++- .../System.Net.Http/src/System/Net/Http/HttpClient.cs | 10 ---------- 4 files changed, 10 insertions(+), 14 deletions(-) create mode 100644 src/libraries/System.Net.Http/src/ILLink/ILLink.Substitutions.mobile.xml diff --git a/src/libraries/System.Net.Http/src/ILLink/ILLink.Substitutions.mobile.xml b/src/libraries/System.Net.Http/src/ILLink/ILLink.Substitutions.mobile.xml new file mode 100644 index 00000000000000..5b705abeb24bda --- /dev/null +++ b/src/libraries/System.Net.Http/src/ILLink/ILLink.Substitutions.mobile.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/libraries/System.Net.Http/src/ILLink/ILLink.Substitutions.xml b/src/libraries/System.Net.Http/src/ILLink/ILLink.Substitutions.xml index 8af1dcbdfa8a6a..5e70f6fbb5d7d5 100644 --- a/src/libraries/System.Net.Http/src/ILLink/ILLink.Substitutions.xml +++ b/src/libraries/System.Net.Http/src/ILLink/ILLink.Substitutions.xml @@ -3,8 +3,5 @@ - - - diff --git a/src/libraries/System.Net.Http/src/System.Net.Http.csproj b/src/libraries/System.Net.Http/src/System.Net.Http.csproj index 330c6cf1614468..77ed5b9c436c64 100644 --- a/src/libraries/System.Net.Http/src/System.Net.Http.csproj +++ b/src/libraries/System.Net.Http/src/System.Net.Http.csproj @@ -1,4 +1,4 @@ - + win true @@ -18,6 +18,8 @@ + diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/HttpClient.cs b/src/libraries/System.Net.Http/src/System/Net/Http/HttpClient.cs index 2e1434b0b49935..3b77aeafc0467b 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/HttpClient.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/HttpClient.cs @@ -815,16 +815,6 @@ private void PrepareRequestMessage(HttpRequestMessage request) return (pendingRequestsCts, DisposeTokenSource: false, pendingRequestsCts); } - private static bool IsNativeHandlerEnabled() - { - if (!AppContext.TryGetSwitch("System.Net.Http.UseNativeHttpHandler", out bool isEnabled)) - { - return false; - } - - return isEnabled; - } - private Uri? CreateUri(string? uri) => string.IsNullOrEmpty(uri) ? null : new Uri(uri, UriKind.RelativeOrAbsolute);