不能在便携式类库中使用HttpClient

时间:2013-10-28 16:55:09

标签: .net visual-studio windows-store-apps portable-class-library

我已经通过nugget安装了Microsoft HTTP Client Lib,但我无法使用HttpClient类。它没有看到名称空间System.Net.Http。我是.net / microsoft平台的新手。该项目基于.NET可移植库。

enter image description here

enter image description here

enter image description here

2 个答案:

答案 0 :(得分:2)

您需要为每个项目安装NuGet包。这与“添加参考”相同。仅将其安装到一个项目中并不能使所有项目都可访问。听起来这是个问题,因为你的截图来自对象浏览器。

答案 1 :(得分:0)

当我通过添加引用添加http客户端作为参考时,我已经解决了这个问题。我认为使用.net可移植的lib将允许我访问它所有后续的命名空间。