We have a .NET 4 Website Project created using Visual Studio 2013, it references the System.Net.Http .dll.
This is the line in web.config that loads the .dll:
<add assembly="System.Net.Http, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
The project builds fine but when we try to “Publish Web Site” it gives the following error:
The type or namespace name ‘Http’ does not exist in the namespace ‘System.Net’ (are you missing an assembly reference?)
It looks like the assembly might be loading from the GAC, we have tried putting the assembly in the application’s BIN folder but this makes no difference – it is still showing as a GAC reference on the project property pages.
We have also tried adding:
<runtime>
<assemblyBinding>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
<codeBase version="1.0.0.0" href="/bin/System.Net.Http.dll"/>
</dependentAssembly>
</assemblyBinding>
As suggested here: Could not load file or assembly System.Web.Http.WebHost after published to Azure web site
But this does not seem to work either.
We have changed the Target Framework to 3.5 and 4.5 with no effect.
We have tried publishing from several different machines.
EDIT: We have tried the nuget package suggest in RobAda and it hasn't had the desired effect, we are still getting errors.