Alexandru Circus
Alexandru Circus

Reputation: 5538

Cannot use HttpClient in a portable class library

I've installed Microsoft HTTP Client Lib via nugget but I cannot use the HttpClient class. It does not see the namespace System.Net.Http. I'm new to .net/microsoft platform. The project is based on the.net portable library.

enter image description here

enter image description here

enter image description here

Upvotes: 0

Views: 1032

Answers (2)

Richard Lander
Richard Lander

Reputation: 158

You need to install the NuGet package, per project. That's the same as "Add Reference". Just installing it into one project does not make it accessible for all projects. It sounds like this was the issue, given that your screenshot is from Object browser.

Upvotes: 2

Alexandru Circus
Alexandru Circus

Reputation: 5538

I've solved the problem when I've added http client as a reference via add reference. I've thought that using .net portable lib will gave me access to all it's subsequent namespaces.

Upvotes: 0

Related Questions