HOL*_*zza 12 c# gtk mono gtk# visual-studio-2010
我一直在努力让GTK#在Windows Server 2008 R2 x64上的Visual Studio 2010中工作,这样我就可以开始编写漂亮的跨平台GUI应用程序,但我对C#有点新,我有一个世界麻烦
我安装了最新的Mono for Windows,其中包括GTK#.我还安装了一个单声道2.10.8轮廓在我的项目的目标框架从这里引导松散以下内容:http://erictummers.wordpress.com/2012/01/25/target-mono-from-visual-studio/
我创建了一个新的Windows窗体应用程序并删除引用Windows窗体的东西,并添加引用的GTK#的东西,从这里引导松散以下内容:http://jrwren.wrenfam.com/blog/2008/11/01/gtk-在视觉工作室-2008-上Vista的X64 /
我还添加了对gtk-dotnet的引用以及该指南中的引用.
这是我的应用程序的完整代码:
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();
}
}
}
Run Code Online (Sandbox Code Playgroud)
当我尝试使用任何配置运行它时,我得到以下异常:
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:
Run Code Online (Sandbox Code Playgroud)
我无法弄清楚如何让它找到那个DLL!我甚至尝试复制DLL的4份到几乎每一个文件夹中具有下列名称的解决方案:glibsharpglue-2 glibsharpglue-2.dll glibsharpglue-2.o glibsharpglue-2.o.dll!我甚至尝试从GTK站点安装GTK一体化软件包并将其bin文件夹添加到我的系统路径,然后将相同的4个dll复制到该文件夹中,所有这些都没有运气.
对我疯狂的问题有什么建议吗?我觉得我在这里错过了一些大事.> _ <
HOL*_*zza 19
我想到了!Mono for Windows完全没必要.GTK#for .NET是我所需要的.对于未来想要为跨平台GTK#开发设置Windows环境的任何人,以下是我遵循的步骤:
| 归档时间: |
|
| 查看次数: |
13621 次 |
| 最近记录: |