I recently started following this guide to migrate my project to .NET 4.5.1 and Web Api 2.
The very first thing MS developer Rick Anderson asks you to do is change:<
It needs the system.web.http.webhost which is part of this package. I fixed this by installing the following package:
PM> Install-Package Microsoft.AspNet.WebApi.WebHost
or search for it in nuget https://www.nuget.org/packages/Microsoft.AspNet.WebApi.WebHost/5.1.0
None of these solutions worked for me. I had a tangle of Nuget packages that couldn't update because of circular dependencies on each other.
I would up having to fix this the old-fashioned way. I created a new MVC/web api project and manually copied System.Web.Http
and System.Web.Http.WebHost
from the new project into the Nuget folders of the exisitng solution. From there I updated the references by, OMG, "browsing" and fixed the problem.
None of these ideas helped my project using MVC 5.2.2.
Forcing a reinstall corrected the problem. From the NuGet package manager console:
update-Package -reinstall Microsoft.AspNet.WebApi.WebHost
"Install-Package Microsoft.AspNet.WebApi.Core" worked just fine.
My problem was that the nuget package manager did not do a real update but the files contained references to older versions, so i first removed all the installed mvc related packages (including razor and web api) then installed them over again and updating the version of the razor in views/web.config to version 3.0.0.