Winternet

C# Hello World in Mono on Windows

Filed under: — jwinter on 5/31/2005 at 10:47 pm

The following are the basic steps for quickly getting Mono up and running on Windows.

  1. Download the Mono Installer for Windows. This installs Mono, Gtk#, and XSP (a webserver for serving ASP.NET applications).
  2. Save the following code into a file called HelloWorld.cs
    
    using System;
    public class HelloWorld {
          public static void Main(string[] args) {
             Console.WriteLine("Hello World");
          }
    }
    
    
  3. Click Start–>Mono 1.x.x for Windows–>Mono-1.x.x Command Prompt. This should bring up a terminal window with the Mono directory added to your path. This way gmcs, mono, etc. will work from whatever directory you are currently in.
  4. Type gmcs HelloWorld.cs into the Command Prompt to compile your source code.
  5. Type mono HelloWorld.exe into the Command Prompt to run the program.

Nothing complicated, but I was looking around for something to make sure that the basics were configured correctly.

Comments »

No comments yet.

RSS feed for comments on this post.

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>


0.049 || Powered by WordPress