Unity Linux—Connect to Debugger

Hello Everybody,

I have downloaded and install the Unity Linux beta (5.1.0f3) which running quite nice, and except some crashes here and there, It does what it should. The only thing I cannot get to run is the Mono Debugger. I installed monodevelop

sudo apt-get install monodevelop -y

and if I click on a script file, everything opens as it should, including auto completion and that alike. However I I try to attach to the debugger, I just never works, so I cannot step through the code.

I tried to start the game first and each available process in the list


But all I get is:


Any Ideas how to fix this? Might that be an permission issue?

The answer is in this forum post: https://forum.unity3d.com/threads/solved-dependencies-not-installed.435441/

More than a BUG like the author of that post thinks, I would say that this happens when you have MonoDevelop already installed before you installed Unity.

In resume: first run “sudo apt-get install mono-complete gnome-sharp2”. Then, every time you reopen the editor you will have to right click the Project, in the left, not the solution, and then “options” and change Mono version to 4.5. As the default, at least for Ubuntu 16.04 is “3.5 (not installed)”, and for some reason close and reopen Unity Editor causes MonoDevelop to reload the solution and forget your changes to project options, so Mono version resets to 3.5.

How to debug: you need to have Unity Editor open, do not run your project or you will miss all breakpoints in the Start() method of your scripts. Then switch to the MonoDevelop window, click the play button, and in the dialog to attach to process select “Attach to Unity Editor” the last option, not the first one. Then switch back to Unity Editor and run your game. You will trigger all breakpoints, including the ones in the Start() methods.

Regarding the target framework version and the fact that you cannot set it to 4.5 reliably: the catch here is not about Monodevelop “forgetting” things. It’s the Unity editor that completely rewrites the .Net project file (Assembly-CSharp.csproj and the like). You can make a simple test to check that: before opening anything, open the project file (Assembly-CSharp.csproj if you’re doing C#) and add some modification into it (e.g. add some spaces or comment using a text editor like gedit or kwrite). Then start the unity editor and open your project file in a text editor again: your modifications are gone.

This because the Unity editor uses its own compiler (if I recall correctly… but I looked into it a while ago so you should not take my word for it), and it does not really care about what the .csproj file says. This .csproj project file is automatically generated by Unity so that external tools like MonoDevelop can open it as if it were a “real” .Net solution and know what files are included into it. But once again, Unity does not use this file, and erases it from time to time (when it starts and when you add/remove/move scripts and files I guess).