× {{alert.msg}} Never ask again
Get notified about new tutorials RECEIVE NEW TUTORIALS

System.Web.Http reference defaults to 4.0 version no matter how i try

Leniel Macaferi
Feb 02, 2015
<p>This is what I did to solve an issue very similar to yours:</p> <blockquote> <p>Error 2 Assembly 'Breeze.WebApi2, Version=1.4.0.0, Culture=neutral, PublicKeyToken=f6085f1a45e2ac59' uses 'System.Web.Http, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' which has a higher version than referenced assembly 'System.Web.Http, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' c:\Repos\SPACodeCamper\packages\Breeze.Server.WebApi2.1.4.12\lib\Breeze.WebApi2.dll CC.Web</p> </blockquote> <p>I got this error while doing the course <a href="http://pluralsight.com/training/Courses/TableOfContents/build-apps-angular-breeze">Building Apps with Angular and Breeze - Part 1</a> by John Papa. It happened on step 3.15 after adding the <code>Breeze</code> Web API Controller to CC.Web.</p> <p>To solve it we need to update the following NuGet Packages. I used NuGet Package Manager in Visual Studio 2013:</p> <ol> <li>Microsoft.AspNet.WebApi.Client from 5.0.0 to 5.1.2</li> <li>Microsoft.AspNet.WebApi.Core from 5.0.0 to 5.1.2</li> <li>Microsoft.AspNet.WebApi.WebHost from 5.0.0 to 5.1.2</li> <li>Microsoft.AspNet.WebApi.OData from 5.0.0 to 5.1.2 (this one I had to restart Visual Studio to complete the installation)</li> </ol> <p>Updating the NuGet packages above will take care of bumping <code>System.Web.Http</code>'s version to the correct one, in this case <code>5.1.0.0</code>.</p> <p>This tip was originally posted on <a href="http://stackoverflow.com/questions/21764502/System.Web.Http%20reference%20defaults%20to%204.0%20version%20no%20matter%20how%20i%20try/23639892">Stack Overflow</a>.</p>
comments powered by Disqus