This is on a different machine than the one that my other recent Gtk# question applies to.
I am trying to run a Gtk# program on a Windows 7 x64 computer with all .NETs 1.0 to 4.0 installed. (I have been using Gtk# on this computer in the past, but more than a year ago for the last time.)
Application.Init();
, creation and display of a new window).When I run the application, the following exception is thrown:
System.TypeInitializationException: Der Typeninitialisierer für "Gtk.Container" hat eine Ausnahme verursacht. ---> System.DllNotFoundException: Die DLL "gtksharpglue-2": Die angegebene Prozedur wurde nicht gefunden. (Ausnahme von HRESULT: 0x8007007F) kann nicht geladen werden.
bei Gtk.Container.gtksharp_gtk_container_get_focus_child_offset()
bei Gtk.Container..cctor()
--- End of inner exception stack trace ---
bei Gtk.Container..ctor(IntPtr raw)
bei Gtk.Bin..ctor(IntPtr raw)
bei Gtk.Window..ctor(WindowType type)
bei Gtk.Window..ctor(String title)
bei GtkSharpTest.Program.Main(String[] args) in ...\GtkSharpTest\Program.cs:Zeile 21.
The crucial bit of information seems to be:
System.DllNotFoundException: Die DLL "gtksharpglue-2": Die angegebene Prozedur wurde nicht gefunden. (Ausnahme von HRESULT: 0x8007007F) kann nicht geladen werden.
meaning
System.DllNotFoundException: Unable to load DLL "gtksharpglue-2": The specified procedure could not be found. (Exception from HRESULT: 0x8007007F)
A file named gtksharpglue-2.dll
is located in the Gtk# bin directory that is on the system search path. Notably, my local Mono installation has an older version of that file, but even if I replace the file in the Mono installation with the newer version, the message remains. None of Mono's installation directories is on my search path, anyway.
How can I fix this, and how can I make sure non-tech-savvy users of my Gtk# program will not run into the same issue?
1: Remarkably, the bin directory was not automatically added to the search path by the installer package (either that, or the search path had become too long once again and thus didn't work as desired, not sure any more); I had to manually edit the search path. In any case, before I had done so, libglib-2.0-0.dll
was the file reported to be missing. After I had edited the search path, that file apparently could be loaded, just gtksharpglue-2.dll
cannot.
User contributions licensed under CC BY-SA 3.0