0

What are the other Mono dependencies besides mono-runtime and libmono-system-windows-forms4.0-cil required to run C# Windows Forms applications on Ubuntu Linux 16.04?

Does the answer to our question depend on the C# source code for our Windows Forms applications? For example, hellboy81 wrote on gitter im mono, Feb 10 01:46.

I have Issue with WinForms's TreeView control in Mono under Ubuntu 64 Bit 15.10 (Unity) items are not selectable and selection is not visible

Does there exist a package update or new package to fix this problem?

I believe the other Mono dependency, GTK# 2.0 is found by using:

strace mono ./Simple.exe 

If I add the line:

using GTK;

to Simple.cs and compile:

mcs -r:System.Windows.Forms.dll -r:System.Drawing.dll -pkg:gtk-sharp-2.0 Simple.cs -out:Simple.exe 

The compiler output is:

Package gtk-sharp-2.0 was not found in the pkg-config search path. Perhaps you should add the directory containing `gtk-sharp-2.0.pc' to the PKG_CONFIG_PATH environment variable No package 'gtk-sharp-2.0' found.

May I ask if gtk-sharp-2.0 is a dependency required for System.Windows.Forms and whether there are any other "Mono" dependencies?

Our architect does not want to consider libgtk2.0-cil-dev as an example of a missing Mono dependency. Instead, he wants to find out what dependencies do we need other than mono-runtime and libmono-system-windows-forms4.0-cil for List Box, ComboBox, EditBox, buttons, etc.. Do List Box, ComboBox, EditBox, buttons, etc.. require additional Mono dependencies?

  • @Moderator, How do I format this question? Thank you. – Frank May 10 '16 at 2:22
  • Click on the circular question mark at the top right of the editor and the formatting help will be displayed. – garethTheRed May 10 '16 at 6:28
  • @garethTheRed, Thank you for the nice edit. Would you know of an Linux command we could you use to determine all the Mono dependencies of a C# Windows Forms applications? – Frank May 10 '16 at 6:40
  • Using strace mono ./DataGrid.exe, I just discovered that libgtk-x11-2.0.so.0 is a dependency. Should I also install GTK+ 3.0 to run all types of C# Windows Forms applications on Ubuntu Linux 16.04 if it is not already preinstalled? – Frank May 10 '16 at 11:03
  • The package that provides that library is libgtk-x11 I believe. – garethTheRed May 10 '16 at 11:56
1

The problem here is that your Mono applications are, just like any other source code, outside of the package management system's control. Therefore you need to work out yourself which packages you need to install - nothing will tell you.

You have a few options and the simplest of those is to read the developer's documentation.

Failing that, you can (as you have started) run strace and see what's missing. The problem then is working out which package that file belongs to. In Ubuntu, you can use apt-file as follows:

Install and configure it:

$ sudo apt-get install apt-file
$ apt-file update

Then find the package with:

$ apt-file search gtk-sharp-2.0.pc

and it'll tell you that you need to install libgtk2.0-cil-dev for this file.

Next run the Mono application again and if need be, strace and apt-file will help you find the missing files.

| improve this answer | |
  • Your answer is great. Our architect does not want to consider libgtk2.0-cil-dev as an example of a missing Mono dependency. Instead, he wants to find out what dependencies do we need other than mono-runtime and libmono-system-windows-forms4.0-cil for List Box, ComboBox, EditBox, buttons, etc.. Could you please tell me if List Box, ComboBox, EditBox, buttons, etc.. require additional Mono dependencies? – Frank May 10 '16 at 14:16
  • I just edited the original question to add more information and an additional question. Could you briefly look at it? Thank you – Frank May 10 '16 at 14:32
  • The problem now is that this question is moving from a Linux admin question to a developer question, which may well be better suited to stackoverflow.com. I don't know how much help you'll get over there as your question is quite vague. The 'etc' at the end makes it quite an open ended one. Which packages you'll require really depends on what 'etc' is. – garethTheRed May 10 '16 at 14:57
  • @garethTherRed, Thank you for your comment. I will ask our architect what is meant by "etc" and try to connect with you given Britain and US East Coast time difference. – Frank May 10 '16 at 15:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.