this problem is exactly the same as this post http://forums.asp.net/t/1807797.aspx/1?System+Net+Http+is+not+found and this one on StackOverflow
I have all the latest
The issue is caused because you have a dependency on a newer version of System.Net.Http
, than that required by one of the other assemblies referenced.
The correct way to resolve this issue is to add dependentAssembly
redirects to the app.config
of offending projects. The accepted answer of disabling the errors just masks an underlying problem.
Add the following to the runtime
section of app.config
to remap the old version that can't be resolved to the version referenced in your project. The version numbers should obviously be updated to correspond to your situation.
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
From Visual Studio 2012 and higher, instead of modifying your installation files, use the workaround specified here: Using Microsoft.Bcl.Async with Code Analysis causes errors.
I have had the same problem (couldn't build locally and remotely on azure). This workaround helped me: http://connect.microsoft.com/VisualStudio/feedback/details/760208/nuget-package-for-asp-net-mvc-4-web-api-does-not-reference-correct-net-4-5-assemblies#
here is the part you need:
Copy the System.Net.Http.dll and System.Net.Http.xml files contained in the packages\Microsoft.Net.Http.2.0.20710.0\lib\net40 directory to the packages\Microsoft.AspNet.WebApi.Core.4.0.20710.0\lib\net40 directory. Since the missing System.Net.Http.dll assembly is now in the same location as the referenced System.Web.Http.dll assembly, the code analysis can now properly resolve the conflicting System.Net.Http assembly.
Try the following:
%ProgramFiles(x86)%\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop
%ProgramFiles(x86)%\Microsoft Visual Studio 11.0\Team Tools\Static Analysis Tools\FxCop
FxCopCmd.exe.config
and change AssemblyReferenceResolveMode
from StrongName to StrongNameIgnoringVersion.