5. Development environment (C#): Linux + Monodevelop¶
This chapter describes how to use the Monodevelop IDE on a Linux box to develop in C#.
Important
현재 Mono 라이브러리의 버전 문제로 Ubuntu 에서 C# 프로젝트를 실행할 수 없는 문제가 있습니다. 아이펀엔진과 Monodevelop 개발도구를 설치하기 전 반드시 아래 절차를 따라 Mono 라이브러리 저장소를 설정 해 주시기 바랍니다.
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
// Ubuntu 16.04 일 경우
echo "deb http://download.mono-project.com/repo/ubuntu stable-xenial/snapshots/5.10.1 main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list
// Ubuntu 18.04 일 경우
echo "deb http://download.mono-project.com/repo/ubuntu stable-bionic/snapshots/5.10.1 main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list
sudo apt-get update
sudo apt-get install mono-devel
Important
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
Important
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¶
Run Monodevelop.

Click on
File
in the upper left, then clickOpen
.

There is a ‘mono’ directory that contains C# files, Go to the directory and open
hello.csproj
orhello.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.3.1. Run a project in Monodevelop on 7 or higher version¶
You have to select {project-name}-Custom Command
to run a project as
shown below.

5.3.2. Migration project with older version¶
Your project may not build on 7 or higher version. In this case, you can clean
the project by removing a build directory({project directory}/mono/bin
).
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:
$ echo $MONODEVELOP_SDB_TEST
1
Now, run Monodevelop to check the submenus under Run With. Then Click on the Custom Command Mono Soft Debugger menu.

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:

5.4.2. Using Mono Soft Debugger on 7 or higher version¶
In 7 version, Mono Soft Debugger feature moved to Custom Configuration
menu.

Click Custom Configuration
menu. Then you can see
Custom Command Mono Soft Debugger in the following screen

Important
If you can’t find Custom Command Mono Soft Debugger on
the list, you may check $MONODEVELOP_SDB_TEST
environment value