我对JSON开发相当陌生,刚入门是一项非常重要的任务,很少有通过Google解决方案。在VS 2012项目中启用System.Net.Http
我不能没有增加system.net.http为我的项目
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Net.Http;
对象,如VAR,HttpWebClient,KeyValuePair编译期间抛出了一个错误的一部分取得任何进展。下面是我的尝试:通过
- 重新安装.NET 4.0
- 重新安装.NET 4.5
- 重新包装库。的NuGet
- 引用system.net
没有运气。我甚至试过引用的类在web.config中
<compilation targetFramework="4.5">
<assemblies>
<add assembly="System.Net.Http, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</assemblies>
</compilation>
在
,并再次..
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" />
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
将引发错误的“组件”
我在我的智慧结束。在System.Net.Http无法使用的情况下,我没有引用或做错。
我可以拍我自己。习惯于直接轻松地引用该库,我忘记直接映射它。像魅力一样工作。然而HttpWebClient,FormURLEncodedContent,StreamReader和KeyValuePair(虽然是heirachy的一部分)抛出一个错误:“期望的类或...” – Nanohurtz