I have this really simple Hello World example i wrote on a linux host using Mono and gtk#. It simply shows a windows with a button. Now i tried to get the binary running on windows but failed. i installed the gtk# with the standalone installer from the mono homepage. when i start the application it failes due to:
System.DllNotFoundException was unhandled: Unable to load DLL 'libglib-2.0-0.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E) Source=glib-sharp
Any suggestions? BR
You need either to run your app via mono.exe or just add the mono.exe location to the PATH environment variable value. You can do that in run-time like that:
[STAThread]
public static void Main(string[] args)
{
var dllDirectory = @"C:\Program Files (x86)\Mono\bin";
Environment.SetEnvironmentVariable("PATH", Environment.GetEnvironmentVariable("PATH") + ";" + dllDirectory);
Run();
}
private static void Run()
{
Gtk.Application.Init();
Forms.Init();
var app = new App();
var window = new FormsWindow();
window.LoadApplication(app);
window.SetApplicationTitle("Game of Life");
window.Show();
Gtk.Application.Run();
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With