[英]Xamarin PCL and Microsoft.Net.Http for HttpClient is this supported on Android AND iOS?
[英]Why Xamarin app not see using microsoft.net.http
我需要使用 httpclient
我安裝 nuget package - Microsoft.Net.Http
在我看到參考之后 - Microsoft.Net.Http
但是當我嘗試使用添加時:
using Microsoft.Net.Http;
Visual Studio 說,那只有 Microsoft.Win32
我嘗試重新啟動與重建,但什么也沒有。
每個 class 都有一個命名空間。 對於HttpClient
,命名空間是System.Net.Http.HttpClient
。 要在您的應用程序中使用HttpClient
,您需要:
using System.Net.Http;
Very often the Classes inside the nuget package will have a namespace that starts with the nuget package name, but that is not a requirement. 在這種情況下,它是不同的。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.