0
votes

I have built a C# and GTK# program with Mono on Linux, and now I'm trying to run it on Windows 10. To see if I can get anything to run at all, I'm trying the HelloGTK example from the MonoDevelop documentation: http://www.monodevelop.com/documentation/stetic-gui-designer/

On the Windows 10 machine, I first tried installing Mono (32-bit), and running the application from the Mono command prompt as mono HelloGTK.exe, but it terminates instantly without any error message. I then tried uninstalling Mono and installing Gtk#, but with the same result: the application terminates silently when run from the Windows command prompt.

  1. Could it be a .NET version mismatch, or missing .NET components? .NET is enabled (versions 3.5 and 4.6) in the Control Panel, but not all sub-items are checked. The program is built against .NET version 4.5. I built a console application (with Mono on Linux) and it runs on the Windows machine without Mono installed. Is this enough for verifying the .NET status or could it still be an issue?

  2. Could it be that the application does not find the GTK# libraries? Is there any way to verify the GTK# installation?

  3. Could it be a GTK# version mismatch? The application is built against GTK# 2.12, and I installed 2.12.38 on the Windows machine, so I find this unlikely.

Any hints on how to troubleshoot this issue would be most appreciated!

2
To run a GTK# program, you need the runtime. Actually, The system searches the Blobal Assembly Cache for the libraries to bind to in runtime. You can install the runtime directly (inserting the GTK# runtime and GTK+ runtime into the GAC of .NET) or use Mono complete, which uses a differenct/own GAC, so you need to explicitely use mono then. Try [1] for more information. [1] mono-project.com/docs/gui/gtksharp/installer-for-net-frameworkauX

2 Answers

0
votes

forget all that:

native docker is now available on windows, so:

  1. dockerize your app and make your image
  2. copy to a windows box
  3. run in docker
  4. done

plus some details that probably need to be filled in. but docker works and will make your life infinitely easier where cross-platform issues are concerned.

0
votes

The problem turned out to be in the code generated by the Stetic GUI designer which is included in MonoDevelop:

protected virtual void Build ()
{
    ...
    this.Title = global::Mono.Unix.Catalog.GetString ("MainWindow");

With the above line commented out the application runs on Windows 10 with GTK# installed.