SGN SGN - 11 days ago 4
C# Question

Update System.Net.Http.Formatting from Version=4.0.0.0 to Version=5.2.3.0

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

Answer

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" />
Comments