How to install Mono on Ubuntu 16.04

Tutorial Difficulty Level    

Sponsored by Microsoft, 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.

You can easily install Mono on your Ubuntu 16.04 server. First ensure that your server has the latest versions of all of the tracked repositories, which means you get the latest versions of Mono.

 

Now install the required package:

 

Wasn’t that easy?!  You can now run your .NET Applications on Linux.

After you get Mono installed, it’s probably a good idea to run a quick Hello World program to make sure everything is set up properly. That way you’ll know that your Mono is working before you try writing or running a more complex application.

To test the most basic functionality available, copy the following code into a file called hello.cs.

 

To compile, use mcs:

 

The compiler will create “hello.exe”, which you can run using:

 

The program should run and output: