Compiling and running Microsoft .Net Framework apps at Rhomb.io Class 1 boards (mono)

Introduction

If you have skills for developing apps at Microsoft .Net framework, for example C#, you can install the mono project libraries to have compatibility at our Rhomb.io Class 1 boards.

With that libraries, you can compile a .cs sourcecode to an .exe application and execute it. All the process can be done at our Class 1 Rhomb.io boards.

Installation

You will need a Rhomb.io Class 1 board with an operating system installed and booted. This was tested at Debian. Yo can follow this steps to generate the boot media for your selected SO. You will need an internet connection attached to your board.

Add the Mono repository to your system

This steps are for Debian for Rhomb.io, for other OS, please follow this guide: http://www.mono-project.com/download/stable/#download-lin

Open terminal and insert this for adding the needed repository:

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb http://download.mono-project.com/repo/debian stable-jessie main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list
sudo apt-get update

Install Mono

Please, insert this command at a terminal for installing the needed software.

sudo apt-get install mono-complete

You will need to wait a couple of minutes.

Compiling a C# program

For testing you can compile a very simple hello world app developed with C#. Please open terminal and insert this command to create a new one empty .cs file

sudo nano hello.cs

Copy and paste this sourcecode to the nano file that you are editing

using System;

public class HelloWorld
{
   static public void Main ()
   {
       Console.WriteLine ("Hello Rhomb.io World");
   }
}

Press Ctrl+X to close the nano editor and answer "Yes" to save the file.

To compile, use this command:

csc hello.cs

Wait a few seconds until the program is been compiled. When that's done, you will see the command prompt.

You can perform an "ls" command and you will see the hello.exe file appeared at your working directory. That file was created by the compiler from the sourcecode that you have created at the previous steps ("hello.cs" file).

Execution

Type the next command for executing your generated .exe application

mono hello.exe

At this point you will see the next text appearing at your command line:

Hello Rhomb.io World

The compilation and execution of a .Net framework C# .exe file was succesful!!