Get a Hello World ASP.NET MVC app up on Mono

The other day I was trying to get started with Mono using ASP.NET MVC. As usual I googled and found a useful post on it http://beyondfocus.com/mono/asp-net-mvc-on-mono-two-options-for-the-ide-crowd/ . But, the post assumes you already know how to deploy an asp.net app on Mono. Anyway here is my attempt to make it easier for folks to hop onto Mono.

 


Alright, so all I am trying to do here is get the ASP.NET MVC 1.0 default template up and running on Mono. There are a few things you need, to get this working:


  1. You need to download a Virtual Machine image from http://www.go-mono.com/mono-downloads/download.html OR install Mono 2.4, apache, mono_mod, and xsp if you already have a linux machine up and running.

  2. Visual Studio with ASP.NET MVC 1.0 installed.

Now, once you have these pre-requisites,


  1. Fire up your vs and create a new ASP.NET MVC 1.0 project. Change whatever text you want to in the template, Here is how mine looks on my machine: image
  2. Publish this application to a folder, say d:\binaries\mono_mvc. and then copy it to your Mono linux machine, copy it to the /srv/www/ folder.


    image

  3. Once you’ve done that, head over to the http://go-mono.com/config-mod-mono/ to create your mod_mono configuration file. Fill out all the necessary details and click on the Download button to download your newly configuration file.

    image
  4. Copy this new configuration file to the /etc/apache2/conf.d/ directory on your linux machine.


    image

  5. The last thing you need to do is restart your apache server


    image
  6. Now you can browse to http://localhost/<your_application_name> to see your asp.net mvc application in it’s full glory :)


    image 

This is obviously a contrived example, but you can see how easy it is to deploy an asp.net mvc application to a linux box running apache and Mono. This is no more complicated than deploying a web app on a Windows box, and all props go to the Mono guys for making Mono easier to use with every release. I hope to dive in deeper into Mono real soon and I’ll share my experiences with you guys.  


I am currently working on LiveForm which makes setting up contact forms on your website a breeze.