Matt Daubneys Blog

C#

The Mono Project and C#

by on Sep.01, 2007, under C#, learning, Mono, programming

So I’ve decided to learn to write C# as I have been repeatedly told that it is a good language (even if it’s designed by MS). So i’ve dug out and installed a copy of MonoDevelop and got started with the Wrox book “Beggining Visual C# 2005″.

I start by writing a simple Hello World application as shown on page 19 of the book, which in Mono looks like the following:

// project created on 9/1/2007 at 8:08 AM

using System;namespace HelloWorld

{

 class MainClass

 {

 	public static void Main(string[] args)

 	{

 		Console.WriteLine("Hello World! My first C# proggy!!");

 		Console.ReadKey ();

 	}

 }

}

A quick build attempt and the first problem comes along with an error of
A quick scout around on Google and I find that MonoDevelop assumes you're writing for .net version 1.1 and you have to change this under Project -> Options -> Runtime Options. Then set Runtime Version to 2.0.

After trying to compile it again nothing happens. A read through the build logs shows that I haven't installed gcms (some kind of mono compiler I assume??) one apt-get install mono-gcms later and everything compiles and runs as it should :)

Leave a Comment more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...