簡體   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