Home > OS >  Why Xamarin app not see using microsoft.net.http
Why Xamarin app not see using microsoft.net.http

Time:09-07

I need use httpclient

I install nuget package - Microsoft.Net.Http

after I see in reference - Microsoft.Net.Http

but when I try add using:

using Microsoft.Net.Http;

visual studio say, that have only Microsoft.Win32

I try restart vs and rebuild and nothing.

CodePudding user response:

Every class has a namespace. For HttpClient the namespace is System.Net.Http.HttpClient. To use HttpClient in your application you need:

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. In this case its different.

CodePudding user response:

Everything other than "System.*" needs to be reffered to somehow.

In this case its a nugget package.

Click here for refference

  • Related