Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not load file or assembly 'System.Web.Http, Version=5.0.0.0

After installing Microsoft.Aspnet.Webapi.Webhost package to my web api project, I end up with the following exception:

Could not load file or assembly 'System.Web.Http, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

like image 802
Hamid Avatar asked Sep 11 '14 15:09

Hamid


2 Answers

I fixed this by reinstalling the NuGet package, which corrects broken dependencies. From the package manager, run Update-Package Microsoft.AspNet.WebApi -reinstall.

like image 91
Hamid Avatar answered Nov 17 '22 23:11

Hamid


When I installed using System.Web.Http.Cors from nugget I get above error.Then I updated webApi Package to latest version.Fixed Issue.

like image 29
saktiprasad swain Avatar answered Nov 17 '22 23:11

saktiprasad swain