Could not load file or assembly 'System.Net.Http, Version=, Culture=neutral on IIS


I started updating some nuget packages and started getting these warnings on build with a conflict for System.Net.Http. As suggested here:

Strange issue with System.Net.Http not found

I replaced all references to System.Net.Http to use the nuget version, instead of the one bundled with Visual Studio. I then changed all redirect bindings (app.configs and web.configs) as suggested everywhere and I got things working locally. But..

When I deploy to our test server I still get the error

Could not load file or assembly 'System.Net.Http, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

I´m using net 4.7.0 and Visual Studio 2017

I searched all my configs for a ref to Version but no hits. Why does the IIS think it needs this one?

My nuget version of the System.Net.Http is 4.3.4 but the actual web.config has these lines

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

Again I can build and run it locally but my server reports the error.

UPDATE: I tried adding this on my servers web.config

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

That makes the error go away! But I still dont get why i need to do this? Like why do my server think it needs to use 4.2.0?
asked on Stack Overflow Apr 8, 2019 by Jepzen • edited Apr 8, 2019 by Jepzen

3 Answers


I updated my solution to .NET Framework 4.7.2 and also made sure the server had this version installed. That solved my problems. After that i can remove the binding redirect.

answered on Stack Overflow Apr 20, 2019 by Jepzen • edited Jun 25, 2019 by Leniel Maccaferri
<bindingRedirect oldVersion="" newVersion="" />

If you can not installed .net 4.7 so remove this line in web.onfig

answered on Stack Overflow Feb 20, 2020 by Fahim Akhtar

For the next person landing on this page wondering why specifying lower version makes it work checkout this answer by Ankush :

also follow this confusing thread on dotnet's github issue page:

answered on Stack Overflow Sep 23, 2020 by RedRose

User contributions licensed under CC BY-SA 3.0