如何通过Nuget将Microsoft.Net.Http安装到Xamarin.Forms PCL项目?

时间:2014-05-31 22:22:03

标签: c# xamarin nuget nuget-package xamarin-studio

由于在可移植类库中无法访问System.Net.HttpClient,因此我尝试将Nuget中的Microsoft.Net.Http软件包安装到Xamarin Studio中的HelloWorld Xamarin.Forms PCL项目,但它始终因此错误而失败: / p>

Could not install package 'Microsoft.Net.Http 2.0.20710.0'. You are trying to install this package into a project that targets 'portable-net45+wp80+MonoAndroid10+MonoTouch10', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

根据该项目的Nuget page,它确实支持PCL。

1 个答案:

答案 0 :(得分:0)

此处有PEBKAC错误。

在Xamarin Studio的Add Packages屏幕上,我选择了Libs而不是All Sources。切换到所有来源允许我找到合适的nuget包。

相关问题