Tuesday, November 4, 2014

Develop C# program on Raspberry Pi, with mono

Sponsored by Xamarin, Mono is an open source implementation of Microsoft's .NET Framework based on the ECMA standards for C# and the Common Language Runtime. A growing family of solutions and an active and enthusiastic contributing community is helping position Mono to become the leading choice for development of cross platform applications.

To install mono on Raspberry Pi, run the command:
$ sudo apt-get install mono-complete

Currently, the installed version is 3.2.8.

Create a simple console program of HelloWorld using C# language, HelloWorld.cs.
using System;

public class HelloWorld
    public static void Main()
        Console.WriteLine("Hello Raspberry Pi...using c#");

Compile it with the command:
$ gmcs HelloWorld.cs

And run it:
$ mono HelloWorld.exe

Updated post: Install Mono/MonoDevelop on Raspberry Pi/Raspbian

No comments: