0
votes

I was working on a VS Extension Project, which required me to use HttpClient. However, I am running into following issue when attempting to create an instance of HttpClient.

"'Could not load file or assembly 'System.Net.Http, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies."

Could someone guide me ?

2

2 Answers

2
votes

Use a Http API that is built into .NET - like HttpWebRequest

0
votes

Indeed you do require the binding redirect.

<dependentAssembly>
    <assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
  </dependentAssembly>