Running ASP.NET MVC 3 on Azure
If you have successfully installed an app running MVC 2 on Azure, and then try to upgrade it to MVC 3, you might run into some troubles.
What might help is to ensure that you have also deployed the new assemblies. MVC 2 is part of .NET 4.0, and its assemblies are included in the standard Azure image, but the new ones aren’t. You have to deploy them yourself.
They won’t get deployed by default because they are in the GAC. You have to make sure that “Copy Local” is selected for the relevant MVC assemblies.
The instructions on how to upgrade and MVC 2 project to MVC 3 are in the release notes, and involve replacing some of the old references with the new ones. But those assemblies have dependencies that aren’t copied.
The assemblies I needed to run an MVC 3 project (using Razor) on Azure are:
- Microsoft.Web.Infrastructure
- System.Web.Mvc
- System.Web.Razor
- System.Web.WebPages
- System.Web.WebPages.Deployment
- System.Web.WebPages.Razor
I’m not 100% I needed System.Web.WebPages.Razor, but it seemed like a good one to have.
I did not need System.Web.WebPages.Administration. If you include that, you need to include NuGet as well.
I don’t actually know what any of those assemblies specifically do (I don’t know what the WebPages or Microsoft.Web.Infrastructure assemblies are for), but this is what I’ve needed to deploy to get it to work.
Member discussion