In this post I will write about setup and configure mono on OS X. I need mono on my Mac since C# is one of my favorite programming language ;)
First of all let’s download Mono SDK and MonoDevelop. The order installation is Mono SDK first then MonoDevelop. The installation of Mono SDK and MonoDevelop should be easy by following the installation wizard.
When the installation finish, open terminal :
# mono version
mono -V
We should get info about the version of mono installed in our machine.
Try to create an ASP.NET Web Application project by selecting menu :
File > New > Solution
. Select C# > ASP.NET > Web Application
Click Run > Run With > Mono Soft Debugger for ASP.NET
ASP.NET on Apache Web Server
To run ASP.Net on Apache web server, we need Mod mono module. It is an Apache 2.0/2.2 module that provides ASP.Net support for Apache web server. The steps installation are :
- Install Apache web server. The steps for OS X Mountain Lion can be found in my previous post
- Install Xcode, OS X development tool. It’s free and can be downloaded via App Store. We need it to compile mod mono installation source
- Download Mod mono source installation here. At the time of write this article I use
mod_mono-2.10.tar.bz2
- Install mod mono module. Open terminal
- Add
mod_mono.conf
reference inhttpd.conf
Add the following code at the end ofhttpd.conf
- Create a web directory with the path
~/Projects/Mono/TestMonoApache/TestMonoApache/
In that directory create anindex.aspx
file - Add an Apache configuration file for mono.
Add the following line at the end of
mod_mono.conf
- Restart apache server with command :
- Open browser and hit
http://localhost/testmonoapache/index.aspx
Cool, now our apache web server can receive request for asp.net page. Thanks for reading and see you in the next post :)
References
- http://www.mono-project.com/Mod_mono
- http://blog.coultard.com/2012/04/developing-using-c-and-mono-on-mac.html
- http://www.ienablemuch.com/2010/10/aspnet-on-mac-os-x-snow-leopard-at-one.html