Photo Gallery

Wednesday, August 9, 2017

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

In this post I will give you the basic resolution for the broken dependencies and you can successfully build your project with Visual studio.


Many people faced this problem after installing Microsoft.Aspnet.Webapi.Webhost package or ASP.NET web API 2.2 core into project.

Error at time of building or execution,

"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)"

The possible solution ,

  • Reinstall the NuGet Package for WebAPI by executing below command into console,
Command : Update-Package Microsoft.AspNet.WebApi -reinstall.
  • Install Microsoft ASP.NET Web API 2.2 CORS Support from NuGet Package Manager.

If you have any questions, post here. Also, provide your valuable suggestions and thoughts in form of comments in the section below.

Thank you !!!

    No comments:

    Post a Comment