繁体   English   中英

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

[英]How do I install Microsoft.Net.Http via Nuget to Xamarin.Forms PCL project?

由于System.Net.HttpClient在可移植类库中不可访问,因此我尝试将Microsoft.Net.Http程序包从Nuget安装到Xamarin Studio中的HelloWorld Xamarin.Forms PCL项目中,但始终会因以下错误而失败:

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页面 ,它确实支持PCL。

PEBKAC错误在这里。

在Xamarin Studio中的“添加软件包”屏幕上,我选择了Libs,而不是“所有源”。 切换到“所有源”使我能够找到合适的nuget包。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM