RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX


The Mono 2.0 Offerings for Debian GNU/Linux. : Page 4

Find out how much of the Mono 2.0 (and beyond) platform is available for Debian users who want up-to-date .NET compatibility.


Up Next, Mono 2.2 with New C# Features

Mono is always a step behind .NET's evolution in order to implement the new features; looking into the future of Mono means seeing the present of .NET. The upcoming Mono 2.2 should be released with a lot of enhancements and new modules, for example, the C# shell and Language Integrated Query (LINQ). The C# shell is an interactive shell that reads-evals-prints C# expressions and is built on top of a library assembly that provides a compiler service. LINQ is a new component of C# version 3.0 that basically extends the use of the SQL query syntax and mechanism to any collection of data represented by a class.

Mono is moving to have complete coverage of these new parts, but the relative Debian packages still don't exist even in Debian's unstable pool. If you want a cutting edge version of Mono, you will have to download the daily tarball and then compile it as follows:

cd /usr/local
wget -c http://mono.ximian.com/daily/mono-latest.tar.gz
tar -xvjf mono-latest.tar.gz
./configure –prefix=/opt

Have a coffee, and then enter:

make install

The steps above will install a Mono 2.2 Beta release under the /opt directory. In order to use it instead of the Mono 2.0 official release already installed with the apt tool, you will have to accordingly set PATH environment variable by adding the /opt/bin directory before the official /usr/bin.

Now you can run the C# interactive shell with the csharp command, and you will get the interactive prompt csharp> meaning you are ready to read-eval-print C# statements. Here is a simple example taken from the Mono project that shows how this works and what LINQ means:

csharp> var last_week = DateTime.Now – TimeSpan.FromDays (7);
csharp> from f in Directory.GetFiles ("/etc")
      >    let fi = new FileInfo (f)
      >    where fi.LastWriteTime < last_week
      >    select f;
{ "/etc/adjtime", "/etc/asound.state", "/etc/ld.so.cache",
  "/etc/mtab", "/etc/printcap", "/etc/resolv.conf" }

This little piece of code shows the files under the /etc directory, which was recently modified. The csharp command could be very useful when you debug single lines of code, and LINQ allows you to exploit the power of SQL in C#.

MoMA, Not the Museum

The Mono Migration Analyzer (MoMA) is a Mono process assembly that analyzes which .NET API people are using in .NET programs and helps determine the runnability of the same API under Mono. Mono could fail to run a .NET program for a number of reasons (for example, if a .NET program calls Platform Invocation Services or P/Invoke). MoMA will indicate whether a program uses P/Invoke or a .NET API not yet supported by Mono. MoMA doesn't exist in the unstable Debian package pool because it is a typical Mono/CLI program that you can unzip under a directory and then run with the Mono runtime.

What About the IDE?

Of course, the Mono framework couldn't come without a decent IDE. Install the monodevelop package and you will have a mature development environment with all the typical features of a modern IDE. In addition to typical instruments such as code completion, class management, and online help, monodevelop also offers an add-in engine for inserting language- or application-specific modules. For instance, if you want to write a macro for OpenOffice with Mono, install cli-uno-bridge and the OpenOffice Automation Samples add-in on monodevelop and learn via the examples.

If you're a the Debian user who wants to run .NET applications, this article should have given you an idea of what Mono in general and Mono 2.0 in particular has to offer, both today an in the near future. Now it is up to you to further explore the Mono landscape for the most up-to-date .NET compatibility.

Roberto Giorgetti is an IT manager and technical writer based in Italy. He is mainly interested in open source exploitation in business and industrial areas. Roberto holds a degree in Nuclear Engineering.
Email AuthorEmail Author
Close Icon
Thanks for your registration, follow us on our social networks to keep up-to-date