【发布时间】:2017-10-02 00:13:45
【问题描述】:
我收到以下错误
Error CS0246: The type or namespace name 'HttpClient' could not be found (are you missing a using directive or an assembly reference?) (CS0246)
但是,我的 using System.Net.Http 没有抛出错误。
我正在使用 Xamarin - 都是最新的。
我已经清理了我的项目,更新了我的所有 NuGet,并确保我的项目包含 Microsoft.Net.Http 包。
我的目标是我的 iOS 项目。
引用如下
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Net;
using System.Net.Http;
using Newtonsoft.Json;
using Xamarin.Forms;
【问题讨论】:
-
也许它想要 System.net insterd?
-
我同时引用了 System.Net 和 System.Net.Http。 :(
-
您的 System.Net.Http 是否在 PCL(Xamarin 项目)中?
-
有时删除它们(右键单击 -> 删除)然后再次添加 nuget 包会有所帮助。
标签: c# xamarin xamarin.ios xamarin.forms xamarin.mac