Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

c#

.net

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

like image 665
Gerald Hughes Avatar asked Mar 10 '23 14:03

Gerald Hughes


2 Answers

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" />
like image 118
abdul Avatar answered Apr 08 '23 20:04

abdul


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

like image 33
Moumit Avatar answered Apr 08 '23 20:04

Moumit