Create .Net applications on Linux and Mac OS X

Mono is an open source deployment of .NET Framework built on Linux, Solaris, Mac OS X, Windows and Unix.

This article is cited from Windows Developer Power Tools by James Avery and Jim Holmes, under license from O'Reilly Media Inc.

Mono is an open source deployment of .NET Framework built on Linux, Solaris, Mac OS X, Windows and Unix. If you're developing on Windows, you can build Mono applications using Visual Studio or SharpDevelop. Both IDE cannot run on Linux or Mac OS X. MonoDevelop starts like a SharpDevelop IDE port, but then develops independently into Mono IDE for Linux desktops using GNOME.

Begin

MonoDevelop requires a Linux version running on the GNOME platform. (Here we will take the example of Red Hat Fedora Core 5). The easiest way to run MonoDevelop is to use the Mono 1.1.15_2 installer (you can download it from mono-project.com, under the heading " Linux Installer for x86 "). Mono installers include all related dependencies and MonoDevelop itself. After completing the installation process, you will see a Mono icon on the screen. Click on it to open the folder containing the MonoDevelop executable. You can also run MonoDevelop on Mac OS X, or use a version for Fink (sourceforge.net), or follow the instructions posted on monodevelop.com.

Using MonoDevelop

When starting MonoDevelop, you will see the IDE and the Welcome screen shown in Figure 1 below.

Create .Net applications on Linux and Mac OS X Picture 1Create .Net applications on Linux and Mac OS X Picture 1
Figure 1 : MonoDevelop's introduction page

If you've ever used Visual Studio or SharpDevelop, you'll see something very familiar. On the left is the Solution Explorer frame, on the right is the main screen, below is the Task List, which displays errors, warnings, and notifications. To create a new program (here called solution), simply go to New → New Project, similar to Figure 2.

Create .Net applications on Linux and Mac OS X Picture 2Create .Net applications on Linux and Mac OS X Picture 2
Figure 2 : New Solution dialog box.

On the left, you can see countless options for MonoDevelop solutions. Along with the usual options of C # and Visual Basic, you will see a couple of interesting solutions. Below the Boo heading are projects that work with non-Microsoft .NET languages, inspired by Python, called Boo. Under NUnit, you can create a project that contains NUnit tests. The actual ILAsm section allows you to create a Console project directly written in Intermediate Language (IL). For example, you can create a Gtk # 2.0 Project (in C # environment).

Gtk # is the UI framework built in Mono. You can create Mono applications that run on Linux, Windows and Mac OS X. New projects can be seen as shown in Figure 3.

Create .Net applications on Linux and Mac OS X Picture 3Create .Net applications on Linux and Mac OS X Picture 3
Figure 3 : A new GTK # solution.

Now, it all looks even more familiar. The files are arranged on the left, in Solution Explorer, just like in other IDEs. The References folder includes a list of parts this solution refers to. The Resources folder contains all resource files that are in solution. The User Interface directory group gathers all current screens in the solution. Select a single screen in the folder that is uploaded for the designer to look like Figure 4.

Create .Net applications on Linux and Mac OS X Picture 4Create .Net applications on Linux and Mac OS X Picture 4
Figure 4 : MonoDevelop's UI designer

The design side is put on the main screen. The Widgets Palette on the right includes all available Widgets, and the Properties window below shows the Widget properties for you to choose. You can drag Widget into the designer easily. If you try to add a File Selection Widget (File Chooser Widget), the running application will look something like Figure 5:

Create .Net applications on Linux and Mac OS X Picture 5Create .Net applications on Linux and Mac OS X Picture 5
Figure 5 : An application running Gtk #.

Running a Gtk # application in MonoDevelop is quite fast and easy. There is an amazing point that you can move this application right into Windows or Mac OS X, until the Mono Framework is still installed.

Use code completion mechanism

MonoDevelop enhances performance with a code completion mechanism, accelerating your typing speed. It can't be called IntelliSense, a brand in the market, but it's quite similar. MonoDevelop will give you some suggestions based on what you typed in the coding window, as shown in Figure 6.

Create .Net applications on Linux and Mac OS X Picture 6Create .Net applications on Linux and Mac OS X Picture 6
Figure 6 : Complete code in MonoDevelop.

Nunit integration

MonoDevelop intelligently supports testing component integration mechanisms. NUnit add-in takes the form shown in Figure 7.

Create .Net applications on Linux and Mac OS X Picture 7Create .Net applications on Linux and Mac OS X Picture 7
Figure 7 : NUnit add-in.

On the top left is the traditional red, green, and yellow tree view of the tests on NUnit, which shows which one is not. Below, you can see the diagram of the previously checked heading. From the chart, you will know that the first time there is only one check, then three, then two and one failure. Switch to the right, under the 'Test result' section, you can see a list of test parts with which results, which are not. MonoDevelop's NUnit integrator is clearly one of the strongest components.

Support

You can find MonoDevelop support online in IRC or via email list, or access via links on the tool's home page.

MonoDevelop in a Nutshell

MonoDevelop is being developed very actively. Two new versions have been released this year. MonoDevelop is not Visual Studio, but quite similar to IDE, with some exceptions such as NUnit support. It is very valuable if you are developing on a Linux or Mac OS X platform.

Overview of MonoDevelop

MonoDeveloptool Introduction version .11 Home http://www.monodevelop.com Strong support tool page http://www.windevpowertools.com/tools/65 Summary An open source IDE for Linux running GNOME and Mac OS X GPL copyright type Online resources FAQ Support FrameworkNET 1.0, 1.1, 2.0;Mono 1.0, 2.0

Related tools in this book: SharpDevelop, NUnit.

4.5 ★ | 2 Vote