When deploying latest Umbraco 7.2.1 to a test server via Web Deploy (through TeamCity) I got this error:
- Could not load file or assembly ‘System.Web.Http, Version=126.96.36.199, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The system cannot find the file specified.
Turns out the following DLLs weren’t being deployed to the bin folder (these were part of various nuget packages as I installed the Umbraco nuget package):
The fix for this was to find the reference in the website project and set copy local False then True. It’s missing a <private>True</private> flag in the project file.
If you get an issue like this I suggest you compare the bin folder vs your local site and see if anything’s missing.
Also while sorting this out I found an umbraco recommendation to upgrade to the latest version of MVC4 by running this command in the package console:
- Update-Package Microsoft.AspNet.Mvc -Version 4.0.40804
Worth doing as well. After this I also had to set copy local False/True on System.Web.Mvc to get the latest MVC dll to copy in.