PlatformNotSupportedException用于在PCL和Xamarin.iOS应用程序上的HttpClient和Wait/Async操作

PlatformNotSupportedException用于在PCL和Xamarin.iOS应用程序上的HttpClient和Wait/Async操作,xamarin.ios,xamarin,async-await,portable-class-library,Xamarin.ios,Xamarin,Async Await,Portable Class Library,我正在尝试向我的可移植类库添加wait/async支持。 在我的Xamarin.iOS项目中,我创建了对PCL的引用(配置文件78)。 每次我尝试调用PCL异步方法时: var result = await new Class1().Do(); 我收到以下错误(stacktrace): System.PlatformNotSupportedException:不支持此平台。 2014-03-29 17:48:06.634 HelloWorld5[2014:60b]未处理的托管异常:不支持此平台

我正在尝试向我的可移植类库添加wait/async支持。 在我的Xamarin.iOS项目中,我创建了对PCL的引用(配置文件78)。 每次我尝试调用PCL异步方法时:

var result = await new Class1().Do();
我收到以下错误(stacktrace):

System.PlatformNotSupportedException:不支持此平台。
2014-03-29 17:48:06.634 HelloWorld5[2014:60b]未处理的托管异常:不支持此平台。(系统平台不支持异常)
在0中的System.ExecutionContextLightup.Run(System.ExecutionContextLightup executionContext,System.Action`1回调,System.Object状态)[0x00000]处
0中的System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run()[0x00000]
在Microsoft.Runtime.CompilerServices.TaskWaiter+c__DisplayClassa.b__1(System.Object状态)[0x00000]中:0
在/Developer/MonoTouch/Source/MonoTouch/src/UIKit/.pmcs compat.UIKitSynchronizationContext.cs:24中的MonoTouch.UIKit.UIKitSynchronizationContext+c_u_uanostorey89.m_ua9()[0x00000]处
在NoasoucActuoPosix.Apple()[0x0000 ] in /Deave/MonoTouch /Soal/MaCoRe/Src/Fung/PMCS COMPAT.NSAPTA.CS:87
at(包装器管理为本机)MonoTouch.UIKit.UIApplication:UIApplicationMain(int,string
[],intptr,intptr)
在/Developer/MonoTouch/Source/MonoTouch/src/UIKit/.pmcs compat.UIApplication.cs:38中的MonoTouch.UIKit.UIApplication.Main(System.String[]args,System.String principalClassName,System.String delegateClassName)[0x0004c
在c:\Downloads\HelloWorld5.BackgroundTest\HelloWorld5\HelloWorld5\Main.cs中的HelloWorld5.Application.Main(System.String[]args)[0x00001]处
程序“Mono”已退出,代码为0(0x0)。
调试会话已结束。
程序“[5932]HelloWorld5.vshost.exe:程序跟踪”已退出,代码为0(0x0)。
程序“[5932]HelloWorld5.vshost.exe”已退出,代码为0(0x0)。
我使用的是Xamarin软件的稳定版本。 请在此处找到示例项目:

这是因为代码删除不再可用而修复的吗?您可能需要在app.config中进行绑定重定向。我想是的,因为从那时起,对Xamarin.iOS进行了大量更新
System.PlatformNotSupportedException: This platform is not supported.

2014-03-29 17:48:06.634 HelloWorld5[2014:60b] Unhandled managed exception: This platform is not supported. (System.PlatformNotSupportedException)
  at System.ExecutionContextLightup.Run (System.ExecutionContextLightup executionContext, System.Action`1 callback, System.Object state) [0x00000] in <filename unknown>:0 
  at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run () [0x00000] in <filename unknown>:0 
  at Microsoft.Runtime.CompilerServices.TaskAwaiter+<>c__DisplayClassa.<OnCompletedInternal>b__1 (System.Object state) [0x00000] in <filename unknown>:0 
  at MonoTouch.UIKit.UIKitSynchronizationContext+<Post>c__AnonStorey89.<>m__A9 () [0x00000] in /Developer/MonoTouch/Source/monotouch/src/UIKit/.pmcs-compat.UIKitSynchronizationContext.cs:24 
  at MonoTouch.Foundation.NSAsyncActionDispatcher.Apply () [0x00000] in /Developer/MonoTouch/Source/maccore/src/Foundation/.pmcs-compat.NSAction.cs:87 
  at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication:UIApplicationMain (int,string
[],intptr,intptr)
  at MonoTouch.UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0004c] in /Developer/MonoTouch/Source/monotouch/src/UIKit/.pmcs-compat.UIApplication.cs:38 
  at HelloWorld5.Application.Main (System.String[] args) [0x00001] in c:\Downloads\HelloWorld5.BackgroundTest\HelloWorld5\HelloWorld5\Main.cs:17 
The program 'Mono' has exited with code 0 (0x0).
Debugging session ended.
The program '[5932] HelloWorld5.vshost.exe: Program Trace' has exited with code 0 (0x0).
The program '[5932] HelloWorld5.vshost.exe' has exited with code 0 (0x0).