Archive for December, 2009

Is my code compiled on Mono (or Microsoft .NET)?

If you want to distinguish between your .NET program compiled on Mono and your program compiled on Microsoft Windows you can use the “__MonoCS_” pre-processor flag!

using System;
using System.IO;
public class AmIMono
{
    public static void Main()
    {
#if __MonoCS__
        Console.WriteLine("Hello Mono! ");        
#else
        Console.WriteLine("No Mono! [...]

Tuesday, December 22nd, 2009