I’ve been trying for a while to get this working. It all seemed so-near-and-yet-so-far. But here is the Visual Studio 2010 C# Asp.Net MVC4 Template Project which works on my Mac:
Visual Studio 2010 Asp.Net Mvc4 CS# Web Application Template modified for Mono
There’s a list of issues which frustrated earlier attempts but the above link is to a project that does build and run on my Mac. Things to make it work included:
- Using VS2010 instead of VS2012 to generate the template. (So no version 4.5
- Got the latest Xamarin Studio, previously known as MonoDevelop
- My mono version says: Mono JIT compiler version 2.10.12 (mono-2-10/c9b270d Thu Mar 7 21:38:12 EST 2013)
- There’s a list of potential issues to address described in this stackoverflow post, I think what I did was just:
- Delete Microsoft.Web.Infrastructure.dll from the bin directory
- I also removed Entity Framework References as that’s not yet done on the Mono.
- At first I commented out the line
AreaRegistration.RegisterAllAreas();inglobal.asax.cs Application_Startbecause it caused an error which appeared to refer to Entity Framework but that might just have been because I had removed System.Web.DynamicData too, so I put DynamicData back in. - The bundling of styles didn’t appear to work but this turned out to be a ‘typo’ in the project template – or rather, the fact that Windows is mostly case-insensitive.
App_Start/BundleConfig.csreferred toSite.cssassite.css. - Having taking the ‘intranet’ template which uses Windows authentication, I changed the
web.configlineto. You may feel I should have used the ‘internet’ template instead of the internet one. - I included all the nugetted package dlls in the zipfile, except that I deleted the EntityFramework stuff.
Kudos to all who worked so hard to make MVC4 on Mono possible. And of course to those who made MVC4 possible at all.


