I am losing my mind over this reference error. I've added the Microsoft.Net.Http
Nuget package, made sure the System.Net.Http
reference is added to the page, imported the System.Net.Http
namespace to the class. Nothing. I even went as far as to recreate the project from scratch using a blank template.
Can someone offer some ideas? Thanks!
The HttpClient class resides on the System. Net. Http namespace, which is a brand new . NET 4.5 namespace.
HttpClient class provides a base class for sending/receiving the HTTP requests/responses from a URL. It is a supported async feature of . NET framework. HttpClient is able to process multiple concurrent requests. It is a layer over HttpWebRequest and HttpWebResponse.
Not sure if you have already tried this, but:
All I did was add the System.Net.Http in the project references.
In the Project Explorer, right click references -> add reference, then tick the relevant checkbox from the list of dlls and click OK
In my visual studio 2017 Xamarin.forms project I had the same problem. If I right click my solution, there is the "Manage NuGet packages..." If I select it, in the "Browse", I look for "System.net" I selected the found item, checked the checkboxes for the project and clicked "Install"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With