asp.net-mvcasp.net-web-apivisual-studio-2013asp.net-mvc-5.1

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...


Solution

  • 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