GTK # en Visual Studio 2010
He estado intentando todo el día para que GTK # funcione en Visual Studio 2010 en Windows Server 2008 R2 x64 para poder comenzar a escribir agradables aplicaciones GUI multiplataforma, pero soy algo nuevo en C # y tengo un mundo de problemas
Instalé el último Mono para Windows que incluye GTK #. También instalé un perfil Mono 2.10.8 para ser el marco de destino de mi proyecto siguiendo la guía de aquí abajo:http://erictummers.wordpress.com/2012/01/25/target-mono-from-visual-studio/
Creé una nueva aplicación de Windows Forms y eliminé las referencias a los formularios de Windows Forms y añadí referencias para GTK # stuff, siguiendo la guía a continuación:http://jrwren.wrenfam.com/blog/2008/11/01/gtk-in-visual-studio-2008-on-vista-x64/
También agregué una referencia a gtk-dotnet además de las de esa guía.
Este es el código completo de mi aplicación:
using System;
using System.Runtime.InteropServices;
using System.Collections.Generic;
using System.Linq;
using Gtk;
namespace GridToGo
{
static class Program
{
[STAThread]
static void Main()
{
Application.Init();
Window myWin = new Window("My first GTK# Application! ");
myWin.Resize(200, 200);
myWin.Destroyed += new EventHandler(myWin_Destroyed);
Label myLabel = new Label();
myLabel.Text = "Hello World!!!!";
myWin.Add(myLabel);
myWin.ShowAll();
Application.Run();
}
static void myWin_Destroyed(object sender, EventArgs e)
{
Application.Quit();
}
}
}
Cuando intento ejecutar esto con cualquier configuración, obtengo la siguiente excepción:
System.TypeInitializationException was unhandled
Message=The type initializer for 'Gtk.Application' threw an exception.
Source=gtk-sharp
TypeName=Gtk.Application
StackTrace:
at Gtk.Application.Init()
at GridToGo.Program.Main() in F:\visual-studio\GridToGo\GridToGo\Program.cs:line 13
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: System.DllNotFoundException
Message=Unable to load DLL 'glibsharpglue-2': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
Source=glib-sharp
TypeName=""
StackTrace:
at GLib.Thread.glibsharp_g_thread_supported()
at GLib.Thread.get_Supported()
at Gtk.Application..cctor()
InnerException:
¡No puedo averiguar cómo conseguir que encuentre esa DLL! Incluso intenté copiar 4 copias de la DLL en casi todas las carpetas de la solución con los siguientes nombres:glibsharpglue-2
glibsharpglue-2.dll
glibsharpglue-2.o
glibsharpglue-2.o.dll
! También intenté instalar el paquete todo en uno GTK desde el sitio de GTK y agregar su carpeta bin a la ruta de mi sistema, y luego copiar los mismos 4 dll en esa carpeta, todo sin suerte.
¿Algún consejo para mi problema loco? Siento que me estoy perdiendo algo grande aquí. > _ <