Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The type or namespace name 'Http' does not exist?

I have this portable class library, its settings it Windows Phone 8, Windows Store and .NET 4.5.

I'm trying to add the HttpClient, but after I add it by NuGet its runtime version is v4.0.30319, and when i try to using System.Net.Http it states:

The type or namespace name 'Http' does not exist in the namespace 'System.Net' (are you missing an assembly reference?)

The following is added as a reference, and was added by NuGet upon install:

  • System.Net.Http
  • System.Net.Http.Extensions
  • System.Net.Http.Primitives

The class I'm trying to use is HttpClient in my portable class library :-/

enter image description here

like image 917
Jason94 Avatar asked Nov 21 '13 17:11

Jason94


1 Answers

This MSDN blog post makes it clear that you need to use this special release of HttpClient.

To use the HttpClient package, right click on your solution, go to the Manage Nuget Packages dialog, search for Id Microsoft.Net.Http, and make sure “Include Prerelease” is turned on.

This was released last February, but I haven't seen any updates to indicate that it is now obsolete.

EDIT
Here's the page for the latest version of this package

like image 51
Sven Grosen Avatar answered Nov 22 '22 13:11

Sven Grosen