After days of research, I've learned several things, first and foremost being that Mono 3.x is not supported on Ubuntu 12.04.
So, MVC 4 is out of the question on that OS (and most other Linux OS's that I messed with). For future reference, I was finally able to get MVC 3 working on Ubuntu 12.04 doing the following:
- Install Ubuntu 12.04 from the ISO using a Hyper-V VM (I will happily give details on that setup if anyone wants them).
- Install all Ubuntu updates (restart required).
- Open a terminal window (Ctrl+Alt+T).
(Optional) Install XRDP, which allows remote desktop connections to Ubuntu VM. I can't stand the default terminal server window for Hyper-V with *nix systems, as the keyboard/mouse mappings are goofy.
sudo apt-get install xrdp
(Optional) Use
ifconfig
at the terminal to get the VMs IP address which you can use for remote desktop connections.Install Apache2.
sudo apt-get install apache2
Install Apache2 threaded dev (required for XSP4, installed below).
sudo apt-get install apache2-threaded-dev
Install Mono-runtime package.
sudo apt-get install mono-runtime
Install Mono-complete package.
sudo apt-get install mono-complete
Install XSP4 (this is a very light-weight web server you can use for development).
sudo apt-get install mono-xsp4
Install ASP.NET examples package. Apparently XSP4 doesn't install everything it needs, but requires some set of ASP.NET components be installed separately in order to work.
sudo apt-get install asp.net-examples
After this, you can set up a folder for your MVC 3 site in /var/www
and bin deploy your site. It is very important that certain assemblies are copied into your site folder to make it work, namely:
- System.Web.Helpers
- System.Web.Mvc
- System.Web.Razor
- System.Web.Routing
- System.Web.WebPages
- System.Web.WebPages.Razor
- System.Web.WebPages.Deployment
So make sure these are set to "copy local" or figure out where the right versions are on your Windows system and manually copy them to your site folder. Then, you can configure Apache and test your site using XSP4 (again, I'll give details if requested):
cd /var/www/sitefolder/
xsp4
Which will show you something like this:
xsp4
Listening on address: 0.0.0.0
Root directory: /var/www/sitefolder
Listening on port: 8080 (non-secure)
Hit Return to stop the server.
And you can hit the site in a browser on the VM with localhost:8080
.
Hope this helps someone in the future.