问题
Right now I am trying to learn how to use gtk# and Xamarin studio , but after I create the .EXE I cant run it with .NET. I am really new to C# and I have no idea what my program needs to work in .Net , It runs fine in mono but I would just like to see if It could work without mono .
When I try to run the Exe from cmd I get this
Unhandled Exception: System.DllNotFoundException: Unable to load DLL 'libgtk-win
32-2.0-0.dll': The specified procedure could not be found. (Exception from HRESU
LT: 0x8007007F)
at Gtk.Application.gtk_init(Int32& argc, IntPtr& argv)
at Gtk.Application.Init()
at Notepad.Notepad.Main(String[] args)
The program I was trying to create is just a clone of notepad made in gtk# .
回答1:
If you are running the GTK# app on a different machine than the one you used to develop, then you need to have the following dependencies installed in order for your app to run perfectly:
The .NET Framework Runtime for the version you are targetting (either mono or ms, both are fine)
The GTK# Framework (You can find it here: http://download.xamarin.com/Installer/gtk-sharp-2.12.20.msi)
GTK+ Libraries: GTK# is a binding to GTK+ and not a full port of it. So you also need the GTK+ libraries from http://www.gtk.org/download/win32.php
Notes:
In case of point 2, you can optionally include the gtk# msi as part of your installation package. In case of 3, you can either download the full gtk+ bundle (consisting of glade and other 3rd party libraries) or just the individual runtime dlls for gtk, gdk, pango, etc for a minimalist installation.
来源:https://stackoverflow.com/questions/15234211/running-an-gtk-application-made-in-monodev-with-net