Could not load file or assembly 'System.Web.Mvc'

We're using Azure cloud to run a deployment and I got the same error. Since you can't really install packages onto the server instances, the way to solve this is to go into References for your project, find the reference to the library that it's complaining is missing, go into properties, then set Copy Local to True. Redeploy and you're all set.


The correct fix for this issue is to:

  1. Right-click on References in your Solution Explorer and choose Manage NuGet Packages
  2. On the left side select Updates
  3. In the middle section select Microsoft ASP.NET MVC
  4. You should see an Update button appear in your selection, click on it

That's it...accept any T&Cs that might pop-up and either publish or run your project locally. If you're still having problems running your project locally, try closing Visual Studio deleting the .SUO file for the project and try opening the solution again...try running again.


I'm assuming this is a new machine, seeing as you have the new OS and different version of Visual Studio. I think you need to install MVC Framework version 2, as that's what your Umbraco install is expecting. You can either install the Framework, and get the DLLs into your GAC, or copy the DLLs from your good system to the bin folder of your web application.

Note, you're saying your project "doesn't use" MVC, but I think you'll find Umbraco does. The error, at any rate, is telling you that the system expects to find it.

Tags:

Asp.Net Mvc