Asp.Net MVC4 on Mono & Xamarin/MonoDevelop on Mac – The C# Template Project

Update Jan 2014: Go straight to github for MVC Templates for .Net 4 and .Net 4.5 or see asp-net-mvc4-net-framework-version-4-5-c-razor-template-for-mono-on-mac-and-linux for more recent notes.

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 and (thanks to comment from Stephen) on Linux :
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:

  • Got the latest Xamarin Studio, previously known as MonoDevelop
  • Mono version: I got MVC4 on Framework version 4 running on Mono 2.10.12; and MVC4 on Framework 4.5 on Mono 3.2.5. Nb I'm not sure whether everything related to async is currently working, but many web apps wouldn't want to use async.
  • 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 of Jan 2014 that's not yet done on the Mono, although this may change shortly.
  • At first I commented out the line AreaRegistration.RegisterAllAreas(); in global.asax.cs Application_Start because 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 StyleBundles failed with a typo, or rather a case-sensitivity issue. A lot of .Net code is written on the assumption of a case-insensitive file system, but mono on *nix will usually have a case-sensitive filesystem, so you have to start being pedantic about getting the case correct. For instance App_Start/BundleConfig.cs referred to the file Site.css as site.css, so it wasn't found until I corrected it.
  • Having taking the 'intranet' template which uses Windows authentication, I changed the web.config line <deny users="?"></deny> to <allow users="?"></allow>. But this gives you no security. The simplest route back to a secure website is to instead put in forms authentication, I don't yet have a solution for windows authentication on mono.
  • 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.

Apple Official Windows 8 Drivers – BootCamp 5

Apple has at long last published official Windows 8 support - but only for 64 bit Windows and only if you are running OS X 10.8.3. A tad irritating if, as on my machine, Windows 8 installed itself as 32 bit and not 64 bit.

The small print is at Boot Camp 5: Frequently asked questions

BootCamp Drivers direct download—further help

If you've downloaded bootcamp drivers for Macs to run Windows 7 or 8, but still have problems, here's my summary of the main issues and solutions I know of:

  1. The download file won't open; or it doesn't seem to work somehow; or doesn't contain all the drivers you expect Do the download again using a download manager because sometimes the download appears to finish but hasn't really. There are a couple of download managers I know of for OS X:
    Folx by Eltima, who have been doing Mac software for years
    iGetter has been working well for a decade
  2. You get an error message saying that the drivers can't be installed on this computer model.In this case you may have one of 3 problems:
    1. You clicked the wrong download link. Check the instructions on finding your ModelIdentifier again carefully, and try again.
    2. Some Macs only get drivers for 32-bit versions of Windows and some only get drivers for 64-bit versions of Windows so if you install the wrong one, you'll have to start again.
    3. Back to item one – your download didn't work properly. Get a download manager and try it again
  3. If you no longer have OS X on your machine, or if you did the download in Windows anyway, then opening-a-bootcamp-driver-download-on-windows-7-or-8-with-7-zip is the page that explains how to open the pkg file and the dmg file in Windows
  4. And finally the really obscure one: All you get in your download is drivers for a Motoral modem. I'm not sure what's going on here, so I'm grasping at straws but you could try this: in the download URL, replace the http://swcdn.apple.com/ by using nslookup to to see if you can change which server is 'really' serving your download, for instance:
    http://apple.vo.llnwd.net/
    http://swcdn.apple.com.akadns.net/
    http://95.140.227.134/