You are here:   ArielOrtiz.com > Compilers > Installing Mono C# on Ubuntu

Installing Mono C# on Ubuntu

Installation

These instructions allow you to install Mono C# 2.10 and MonoDevelop 3.0 on Ubuntu 13.04.

Building a C# program

  1. Open MonoDevelop. Type monodevelop and press Enter at the Unity launcher or terminal.
  2. From the IDE’s menu, select File/New/Solution.... In the New Solution dialog window, select C# and choose the Empty Project icon. Type your project’s name (for example: hello_world) in the corresponding text field. You may also specify the project’s location. If you don’t, the project’s directory will be placed under your home folder. Press the Forward button.

  3. In the next New Solution dialog window just press the OK button.
  4. Type Ctrl+N to create and add a new C# source file to your project. In the New File dialog window, check first the Add to project box. Afterwards, select the Empty File icon and type the name for your new file (for example: hello.cs) in the corresponding text field. Finally press the New button.

  5. In the hello.cs editor window, copy the following program and save it using Ctrl+S.

    // The "Hello World!" program in C#.
    
    using System;
    
    namespace HelloWorld
    {
        public class Hello
        {
            public static void Main ()
            {
                Console.WriteLine ("Hello World!");
            }
        }
    }
    
  6. Type Ctrl+F5 to run the program. You should see the following text in the IDE’s Application Output pad:

    Hello World!