Could not load file or assembly 'System.Net.Http
Thanks to @Jehof:
Reason
Web.config
had redirect of System.Net.Http
from 4.0.0
to 4.1.1
, and GAC
had only assembly version 4.0.0
.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
...
<dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.1.1" newVersion="4.1.1.1" />
</dependentAssembly>
...
</assemblyBinding>
</runtime>
</configuration>
Solution
Removing this redirect solved the problem.
Root cause
I think, I had this assembly redirect in Web.config
, because I installed System.Net.Http
via nuget at some point, and then uninstalled it. However assembly redirect was not removed automatically.