Archive for the ‘FreeBSD Development Tools’ Category

Install Mono on FreeBSD step by step

Saturday, September 18th, 2010

Mono is the Microsoft .net framework ported Open Source world and consists of runtime environment, compiler, and web server for handling ASP.NET web sites.

First step is install or update ports collection  using “#portsnap fetch”, then “#portsnap extract” or “#portsnap update”.

#cd /usr/ports/lang/mono

#make install clean
Then follow the configuration and setup options.

It will take some time to build, after installation, and build complete you can start your first c# application

#ee hellowolrd.cs

class Program
{
static void Main(string[] args)
{
System.Console.WriteLine(“Hello world, server time is:{0}”,System.DateTime.Now.ToString());
}
}

save the file and exit.

compile the file using mono compiler:

#/usr/local/bin/mcs hellowolrd.cs -r:System.Web.dll -r:System.Data.dll

run the hellowolrd application using:

# /usr/local/bin/mono helloworld.exe