Could not load file or assembly ‘System.Net.Http, Version=2.0.0.0 in MVC4 Web API

I had the same error while deploying previously converted (from .NET 4.5 to 4.0) web app on IIS 6.0.

In the web.config runtime section I’ve found

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

which I’ve changed to

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

Now works like charm.

Leave a Comment