I have an Asp>Net Website project that targets .NET v4.0. I make use of System.Net.Http in the project and have brought it in via NuGet. On my development machine everything works fine, however, when I deploy to my DEV server the project blows up with this error.
Could not load file or assembly 'System.Net.Http' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Looking in SO I came across this posting from 2012 where one of the answers suggests changing the bindingRedirect value as shown below.
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-1.0.0.0" newVersion="2.0.0.0"/>
This fixes the project on DEV, but every time I redeploy the same fix has to be applied. It seems to me that I have two different versions of System.Net.Http.dll
. One on my local machine and one on DEV. How do I go about moving the version of System.Net.Http.dll
from my development machine over to the DEV machine during deployment?
NOTE: I have searched for the option to set "Copy Local" for System.Net.Http but there is no option to Show All Files in solution explorer. Perhaps this is a Website Project and not a Web Application?