5. Development environment (C#): Linux + Monodevelop

This chapter describes how to use the Monodevelop IDE on a Linux box to develop in C#.


There is a Mono bug that prevents iFun Engine games from running on Ubuntu 16.04. Please update Mono as follows. Automatic updates are planned in future.

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


As of August 2017, iFun Engine does not support the Flatpak MonoDevelop.

5.1. Starting a new project

Enter the following in a command line to start a server project called hello:

$ funapi_initiator hello --csharp


To use Monodevelop IDE, you must create a C# Project. In other words, you must use --csharp as in the example above.

5.2. Opening a project in Monodevelop

  1. Run Monodevelop.
  1. Click on File in the upper left, then click Open.
  1. There is a ‘mono’ directory that contains C# files, Go to the directory and open hello.csproj or hello.sln. (If the project name is not “hello”, open {{ProjectName}}.csproj or {{ProjectName}}.sln.)

Project loading has finished. When the project opens, you can begin coding.


5.3. Building a Project in Monodevelop

You can build without any special configuration from the Build menu or by pressing F8. You can also right-click the project to use the Build, Rebuild, and Clean features.


5.4. Debugging a Project in Monodevelop

To debug in Mono, you need to use the Monodevelop IDE’s Mono Soft Mode Debugger.

5.4.1. Configuring using Mono Soft Debugger

Configure settings for the MONODEVELOP_SDB_TEST environment variable to activate Mono Soft Debugger’s features. Enter the following command:

$ echo "export MONODEVELOP_SDB_TEST=1" >> ~/.profile

This is applied when you log out and then in again or when you reboot. You can check the environment variable configuration as follows:


Now, run Monodevelop to check the submenus under Run With. Click on Custom Command Mono Soft Debugger.


Click Listen. Monodevelop IDE is now configured. Monodevelop IDE is now waiting for debugging.


Now, run the game server and open the debugger. Enter the following:

$ ./hello/mono/bin/Debug/buildcpp/hello-local --mono_debug

Debugging proceeds as follows: