GTK # no Visual Studio 2010
Eu tenho tentado o dia todo para fazer o GTK # funcionar no Visual Studio 2010 no Windows Server 2008 R2 x64 para que eu possa começar a escrever bons aplicativos GUI multiplataforma, mas sou um pouco novo em C # e estou tendo um mundo de problemas.
Eu instalei o mais recente Mono para Windows, que inclui o GTK #. Eu também instalei um perfil Mono 2.10.8 para ser a estrutura de destino do meu projeto, seguindo o guia a partir daqui:http://erictummers.wordpress.com/2012/01/25/target-mono-from-visual-studio/
Eu criei um novo aplicativo Windows Forms e removi referências para o material de formulários do windows e adicionei referências para o GTK #, seguindo o guia a partir daqui:http://jrwren.wrenfam.com/blog/2008/11/01/gtk-in-visual-studio-2008-on-vista-x64/
Eu também adicionei uma referência ao gtk-dotnet em adição àquelas daquele guia.
Este é o código completo do meu aplicativo:
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();
}
}
}
Quando tento executar isso com qualquer configuração, recebo a seguinte exceção:
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:
Eu não consigo descobrir como obtê-lo para encontrar essa dll! Eu até tentei copiar 4 cópias da DLL em praticamente todas as pastas da solução com os seguintes nomes:glibsharpglue-2
glibsharpglue-2.dll
glibsharpglue-2.o
glibsharpglue-2.o.dll
! Eu também tentei instalar o pacote GTK all-in-one do site GTK e adicionar sua pasta bin ao caminho do meu sistema, e então copiar os mesmos 4 dlls para essa pasta, tudo sem sorte.
Algum conselho para o meu problema louco? Eu sinto que estou sentindo falta de algo grande aqui. > _ <