From ae089718659c81f9d24945b3137e1221e5e1adc8 Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Tue, 21 Sep 2021 11:22:38 -0400 Subject: [PATCH] [src] Ignore warning due to obsolete method. (#12779) The warning is new from .net 5 but the code is old and the change of the method is not direct, EscapeDataString does not work as EscapeUriString. --- src/CFNetwork/CFHTTPMessage.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/CFNetwork/CFHTTPMessage.cs b/src/CFNetwork/CFHTTPMessage.cs index 6dd2d27bf214..1645d3b0e7ef 100644 --- a/src/CFNetwork/CFHTTPMessage.cs +++ b/src/CFNetwork/CFHTTPMessage.cs @@ -147,7 +147,11 @@ public static CFHTTPMessage CreateRequest (Uri uri, string method, Version versi CFUrl urlRef = null; NSString methodRef = null; + // the method is obsolete, but EscapeDataString does not work the same way. We could get the components + // of the Uri and then EscapeDataString, but this might introduce bugs, so for now we will ignore the warning +#pragma warning disable SYSLIB0001 var escaped = Uri.EscapeUriString (uri.ToString ()); +#pragma warning restore SYSLIB0001 try { urlRef = CFUrl.FromUrlString (escaped, null);