CFNetworkHandler is not a valid http message handler for watchOS, so show a helpful message if someone tries. (#879)
This commit is contained in:
Родитель
351bb29f0c
Коммит
88a9b809d2
|
@ -837,7 +837,7 @@ This generally indicates that there is a problem with your Xamarin.iOS installat
|
||||||
|
|
||||||
<!--- 2012 used by mmp -->
|
<!--- 2012 used by mmp -->
|
||||||
|
|
||||||
<h3><a name="MT2015"/>MT2015: Invalid HttpMessageHandler `*` for watchOS. Valid values are NSUrlSessionHandler (default) or CFNetworkHandler</h3>
|
<h3><a name="MT2015"/>MT2015: Invalid HttpMessageHandler `*` for watchOS. The only valid value is NSUrlSessionHandler.</h3>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
MT3xxx AOT
|
MT3xxx AOT
|
||||||
|
|
|
@ -66,11 +66,11 @@ namespace XamCore.ObjCRuntime {
|
||||||
// default
|
// default
|
||||||
case null:
|
case null:
|
||||||
return HttpClientHandlerValue;
|
return HttpClientHandlerValue;
|
||||||
|
case CFNetworkHandlerValue:
|
||||||
case HttpClientHandlerValue:
|
case HttpClientHandlerValue:
|
||||||
if (Driver.App.Platform == Utils.ApplePlatform.WatchOS)
|
if (Driver.App.Platform == Utils.ApplePlatform.WatchOS)
|
||||||
throw ErrorHelper.CreateError (2015, "Invalid HttpMessageHandler `{0}` for watchOS. Valid values are NSUrlSessionHandler (default) or CFNetworkHandler", value);
|
throw ErrorHelper.CreateError (2015, "Invalid HttpMessageHandler `{0}` for watchOS. The only valid value is NSUrlSessionHandler.", value);
|
||||||
return value;
|
return value;
|
||||||
case CFNetworkHandlerValue:
|
|
||||||
case NSUrlSessionHandlerValue:
|
case NSUrlSessionHandlerValue:
|
||||||
return value;
|
return value;
|
||||||
default:
|
default:
|
||||||
|
@ -186,10 +186,12 @@ namespace XamCore.ObjCRuntime {
|
||||||
#else
|
#else
|
||||||
case HttpClientHandlerValue:
|
case HttpClientHandlerValue:
|
||||||
if (Driver.App.Platform == Utils.ApplePlatform.WatchOS)
|
if (Driver.App.Platform == Utils.ApplePlatform.WatchOS)
|
||||||
throw ErrorHelper.CreateError (2015, "Invalid HttpMessageHandler `{0}` for watchOS. Valid values are NSUrlSessionHandler (default) or CFNetworkHandler", handler);
|
throw ErrorHelper.CreateError (2015, "Invalid HttpMessageHandler `{0}` for watchOS. The only valid value is NSUrlSessionHandler.", handler);
|
||||||
type = httpModule.GetType ("System.Net.Http", "HttpClientHandler");
|
type = httpModule.GetType ("System.Net.Http", "HttpClientHandler");
|
||||||
break;
|
break;
|
||||||
case CFNetworkHandlerValue:
|
case CFNetworkHandlerValue:
|
||||||
|
if (Driver.App.Platform == Utils.ApplePlatform.WatchOS)
|
||||||
|
throw ErrorHelper.CreateError (2015, "Invalid HttpMessageHandler `{0}` for watchOS. The only valid value is NSUrlSessionHandler.", handler);
|
||||||
type = httpModule.GetType ("System.Net.Http", "CFNetworkHandler");
|
type = httpModule.GetType ("System.Net.Http", "CFNetworkHandler");
|
||||||
break;
|
break;
|
||||||
case NSUrlSessionHandlerValue:
|
case NSUrlSessionHandlerValue:
|
||||||
|
|
|
@ -204,7 +204,7 @@ namespace Xamarin.Bundler {
|
||||||
// MT2012 ** reserved Xamarin.Mac **
|
// MT2012 ** reserved Xamarin.Mac **
|
||||||
// MT2013 ** reserved Xamarin.Mac **
|
// MT2013 ** reserved Xamarin.Mac **
|
||||||
// MT2014 ** reserved Xamarin.Mac **
|
// MT2014 ** reserved Xamarin.Mac **
|
||||||
// MT2015 Invalid HttpMessageHandler `{0}` for watchOS. Valid values are NSUrlSessionHandler (default) or CFNetworkHandler
|
// MT2015 Invalid HttpMessageHandler `{0}` for watchOS. The only valid value is NSUrlSessionHandler.
|
||||||
// MT3xxx AOT
|
// MT3xxx AOT
|
||||||
// MT30xx AOT (general) errors
|
// MT30xx AOT (general) errors
|
||||||
// MT3001 Could not AOT the assembly '{0}'
|
// MT3001 Could not AOT the assembly '{0}'
|
||||||
|
|
Загрузка…
Ссылка в новой задаче