4
votes

Error:

Error CS1705 Assembly 'System.Web.Http' with identity 'System.Web.Http, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' uses 'System.Net.Http.Formatting, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' which has a higher version than referenced assembly 'System.Net.Http.Formatting' with identity 'System.Net.Http.Formatting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'

How do I update System.Net.Http.Formatting from 4.0.0.0 to 5.2.3.0 ?

Edit

Tried Update-Package –reinstall Microsoft.AspNet.WebApi.Client but seems this packet does not contain System.Net.Http.Formatting

2
uses NuGet package: link - Giovanni Russo
@GiovanniRusso , thank, but that didn't fix the problem - Gerald Hughes
@SGN did you remove the existing reference? - Panagiotis Kanavos
@PanagiotisKanavos I removed manually, I used Uninstall-Package, and Update-Package -reinstall - Gerald Hughes
@SGN Update-Package –reinstall Microsoft.AspNet.WebApi.Client it works for me. jajhakumullah khair - anis programmer

2 Answers

6
votes

You need to run the following PM command to fetch System.Net.Http.Formatting assembly.

Install-Package System.Net.Http.Formatting.Extension

To update:

Update-Package System.Net.Http.Formatting.Extension -ProjectName MyProject -Version 5.2.3.0

Check packages.config after installation, it should be listed

<package id="System.Net.Http.Formatting.Extension" version="5.2.3.0" targetFramework="net452" />
1
votes

You need to download and install ASP.Net MVC 4 here or using Web platform installer

Then it will be found in below location on your computer

C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 4\Assemblies\System.Net.Http.Formatting.dll