I'm fairly new to JSON development and just getting started is a major task with very little in the way of solutions via Google.
I can't get anywhere without adding system.net.http as part of my project
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Net.Http;
objects like var, HttpWebClient, KeyValuePair throw up an error during compile. Here's what I tried:
No luck. I've even tried referencing the the class in web.config
<compilation targetFramework="4.5">
<assemblies>
<add assembly="System.Net.Http, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</assemblies>
</compilation>
and again in..
<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>
An error is thrown on "assemblies"
I'm at my wits end. What am I not referencing or doing wrong where System.Net.Http cannot be used.
In .NET 4.5 System.Net.Http is in it's own assembly, you have to go to "Add References" (right click on the project) and select it.
See the MSDN page for HttpClient: http://msdn.microsoft.com/en-us/library/system.net.http.httpclient.aspx
Assembly: System.Net.Http (in System.Net.Http.dll)
The help system reveals that the System.Net.Http namespace is defined in System.Net.Http.dll which as you say is not listed. A quick search of my own filesystem reveals copies
On my system those paths are
C:\Windows\Microsoft.NET\Framework\v4.0.30319
C:\Windows\Microsoft.NET\Framework64\v4.0.30319
System.Net.Http.WebRequest.dll is on the same paths.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With