Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/326.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# PCL配置文件158中的异步/等待也针对Android和IOS_C#_Asynchronous_Xamarin.ios_Xamarin.android_Portable Class Library - Fatal编程技术网

C# PCL配置文件158中的异步/等待也针对Android和IOS

C# PCL配置文件158中的异步/等待也针对Android和IOS,c#,asynchronous,xamarin.ios,xamarin.android,portable-class-library,C#,Asynchronous,Xamarin.ios,Xamarin.android,Portable Class Library,我有一个带有Android和IOS的PCL配置文件。我还想使用async/await。 我找到了一些解决这个问题的方法,但我无法让它工作 当我尝试使用wait时,visual/xamarin studio显示一个错误,提示:Type'System.Threading.Tasks.Task'不可等待 是否有任何方法使其工作或使用异步/等待操作的替代方法?您是否也为Microsoft.Bcl.async安装了nuget软件包?我想您需要它才能在PCL中实现异步/等待。我以前尝试过,但它显示了一个不兼

我有一个带有Android和IOS的PCL配置文件。我还想使用async/await。 我找到了一些解决这个问题的方法,但我无法让它工作

当我尝试使用wait时,visual/xamarin studio显示一个错误,提示:Type'System.Threading.Tasks.Task'不可等待


是否有任何方法使其工作或使用异步/等待操作的替代方法?

您是否也为Microsoft.Bcl.async安装了nuget软件包?我想您需要它才能在PCL中实现异步/等待。

我以前尝试过,但它显示了一个不兼容的错误:无法安装软件包“Microsoft.Bcl.Build 1.0.13”。您正在尝试将此软件包安装到目标为“portable win+net45+sl50+wp80+MonoAndroid10+MonoTouch10”的项目中@ThiagoRomam安装最新版本的NuGet(2.7.2或更高版本),并且您应该能够在您的portable library中安装Microsoft.Bcl.Async NuGet软件包。