[System] Remove any CFNetwork usage from the watchOS profile. Fixes #45847.
authorRolf Bjarne Kvinge <rolf@xamarin.com>
Mon, 24 Oct 2016 17:50:16 +0000 (19:50 +0200)
committerRolf Bjarne Kvinge <rolf@xamarin.com>
Mon, 24 Oct 2016 18:06:06 +0000 (20:06 +0200)
The MacProxy class uses CFNetwork, but since CFNetwork is not a public
framework on watchOS, we can't use it.

So remove MacProxy completely (it only contains internal classes), and throw
PlatformNotSupportedException in any API that used it (the managed networking
stack is not supported on watchOS anyway, so this should be safe).

https://bugzilla.xamarin.com/show_bug.cgi?id=45847

mcs/class/System/ReferenceSources/AutoWebProxyScriptEngine.cs
mcs/class/System/monotouch_watch_System.dll.exclude.sources
mcs/class/referencesource/System/net/System/Net/webproxy.cs

index 4e4d2859b032021c4fe0bbaf2b0dc9f7fb081b2d..f3b840e8f7f56533be087a32001bfdabaacd9a82 100644 (file)
@@ -1,7 +1,9 @@
 using System.Collections;
 using System.Collections.Generic;
 using System.Text.RegularExpressions;
+#if !MONOTOUCH_WATCH
 using Mono.Net;
+#endif
 
 namespace System.Net
 {
index 1f1f61233b04f32ec4b5e7004d2673a8dd13f0d8..8c6728097b7129ea1850e496e88c4002d33a253b 100644 (file)
@@ -107,6 +107,7 @@ Mono.Net.Security/MonoTlsProviderWrapper.cs
 Mono.Net.Security/MonoTlsStream.cs
 Mono.Net.Security/NoReflectionHelper.cs
 Mono.Net.Security/SystemCertificateValidator.cs
+System.Net/MacProxy.cs
 System.Net.Mail/SmtpClient.cs
 System.Net.Security/SslStream.cs
 System.Net.Sockets/TcpClient.cs
index fe5858875faa8c20236f15eb604adbe491b20c26..b61133a980a9b7703f1a428ec686b7a199bd1d55 100644 (file)
@@ -504,7 +504,9 @@ namespace System.Net {
 #if MONO
         public static IWebProxy CreateDefaultProxy ()
         {
-#if MONOTOUCH
+#if MONOTOUCH_WATCH
+            throw new PlatformNotSupportedException ();
+#elif MONOTOUCH
             return Mono.Net.CFNetwork.GetDefaultProxy ();
 #elif MONODROID
             // Return the system web proxy.  This only works for ICS+.