簡體   English   中英

為什么 Xamarin 應用程序看不到使用 microsoft.net.http

[英]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. 在這種情況下,它是不同的。

除了“System.*”之外的所有東西都需要以某種方式引用。

在這種情況下,它是一個金塊 package。

點擊這里參考

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM