Amongst other tools, Mono provides a very interesting C# Interactive Shell that may be very useful on a Raspberry Pi.
Installing C# Shell
C# Shell requires the Mono Framework to be installed on your Raspberry Pi.
Once done, you have to install the shell itself
$ sudo apt-get update $ sudo apt-get install mono-csharp-shell
Starting C# Shell
Once installed, launch the C# Shell:
Or, for elevated privileges
$ sudo csharp
The shell displays the following lines:
Mono C# Shell, type "help;" for help Enter statements below.
Every sentence of C# code may be typed.
A sentence is evaluated when the final
; character is typed (or the closing
} characted for a block of code).
var i = 10;
If the sentence evaluates to a non-void value, the value is displayed:
All the Mono/.NET framework is available, either directly (for
Environment.OSVersion; Unix 188.8.131.52
… or by
using the required namespaces:
using System.Globalization; new CultureInfo("hy-am").DisplayName; "Armenian (Armenia)";
… or even by loading your own assemblies:
LoadAssembly("Raspberry.IO.GeneralPurpose"); using Raspberry.IO.GeneralPurpose; var cnx = new GpioConnection();
Exiting C# Shell
You want to quit C# Shell ?
And it’s over.