Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

assembly uses System.Web.Http 5.1 which has a higher version than referenced assembly System.Web.Http 5.0

I created a new Project in Visual Studio 2013, a WebApi & MVC 5 project and updated all nuget packages. It updated to mvc 5.1. Now I cannot Successfully build the project it says

assembly uses System.Web.Http 5.1.0.0 which has a higher version than referenced assembly System.Web.Http 5.0.0.0

Anyone run into this before? Why these kind of problems do occur so often in Visual Studio? Does anybody know how to solve this because I really am trying hard but no luck so far...

like image 388
visar_uruqi Avatar asked Apr 13 '14 13:04

visar_uruqi


2 Answers

Solved

I opened the Package Manager Console in Visual Studio and run the command

PM> Update-package

It magically resolved everything for me. You can find Package Manager Console under

  1. Tools
  2. Nuget Package Manager
  3. Package Manager Console

This command deletes all the old packages under the package folder and updates everything if necessary, you may also run the command on a specific package. Here all the variants of the command http://docs.nuget.org/docs/reference/package-manager-console-powershell-reference#Update-Package

Let me know if you found this useful I'm curious to know if it just happened to me accidentally

like image 97
visar_uruqi Avatar answered Oct 07 '22 21:10

visar_uruqi


A new version of ASP.NET was released. Announcement here : http://blogs.msdn.com/b/webdev/archive/2014/01/20/announcing-the-release-of-asp-net-mvc-5-1-asp-net-web-api-2-1-and-asp-net-web-pages-3-1.aspx

You probably have two projects in your solution, where project A references project B. Both projects reference ASP.NET, but there is a version mismatch.

like image 29
Patrick J Collins Avatar answered Oct 07 '22 19:10

Patrick J Collins