Writing Your First Program With Mono And MonoDevelop
Installing Mono And MonoDevelop on Gentoo and Debian/Ubuntu(5.10)
Installing Mono And MonoDevelop K/Ubuntu(6.06)
Mono applications can be developed using any text editor and the mono compiler(mcs). Type the following program in your favourite editor:
-
using System;
-
namespace FirstMono
-
{
-
class Hello
-
{
-
public static void Main(string[] args)
-
{
-
Console.WriteLine("Hello World!");
-
}
-
}
-
}

Now go to a shell prompt and compile and run the program:
sh# mono Hello.exe
You can copy the same Hello.exe file to a Windows machine and execute it there; you get the same output.
To create a C# application using the MonoDevelop development environment, follow these simple steps:
- Start Monodevelop from the GNOME/KDE menu.
- Select 'File->New Project' or press Ctrl-Shift-N to create a new Project/Solution. Select "C#" in the left pane and "Console Project" in the right pane of the dialog box.
- Type 'FirstMono' as the project name(in Location->Name field) and press the "New" button. You will see a sample C# file created in the open window(sample code is not created if "Blank Project" is selected in the "New Solution" Dialog box). Modify the string passed to the WriteLine() method if you wish.
- Select "Run->Build Solution" to build the project. Run the project using "Run->Run"(or press "F8"). The output is displayed in the Application Output window at the bottom.

Most of the frequently used operations(like "Build Solution", "Run" etc) can be invoked from the toolbar buttons too.
Related Posts:
Readers who viewed this page, also viewed:
- Boost Filesystem Library: Writing Portable C++ Programs to Acess The Filesystem
- Installing C#, Mono(.NET) & MonoDevelop in Ubuntu Dapper Drake 6.06
- Create ASP.NET 1.0 & 2.0 Applications On GNU/Linux and Windows Using Mono XSP
- Update or Install Applications on Debian/Ubuntu Without an Internet Connection
- Convert DVD Movies to iPod Format(with Subtitles) Using Free Software




















