我已经在网上寻找解决方案,但没有一个。我正在尝试使用GTK#在Visual Studio 2010 C#Express中创建应用程序。该应用程序非常基本,但由于错误而无法运行。错误集中在glibsharpglue-2。
应用
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Gtk;
namespace Ink
{
class MainUI
{
public static void Main()
{
Application.Init();
//Create the window
Window mainWindow = new Window("Ink by InkPuppet");
mainWindow.Resize(500, 600);
//Create a label and insert text
Label tempLabel = new Label();
tempLabel.Text = "Hello World!";
//Add label to form
mainWindow.Add(tempLabel);
mainWindow.ShowAll();
Application.Run();
}
}
}
错误
System.TypeInitializationException was unhandled
HResult=-2146233036
Message=The type initializer for 'Gtk.Application' threw an exception.
Source=gtk-sharp
TypeName=Gtk.Application
StackTrace:
at Gtk.Application.Init()
at Ink.MainUI.Main() in C:\Users\Jared\Documents\DevelopmentProjects\Ink\Ink\MainUI.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.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: System.DllNotFoundException
HResult=-2146233052
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:
我正在引用: - atk-sharp - gdk-sharp - 尖锐的 - gtk-sharp - pango-sharp - 系统 - System.Net
请告诉我如何解决这个问题,我只想进行开发,但这种废话无法阻止任何工作效率。
答案 0 :(得分:0)
我找到了解决方案;我添加了单声道的环境变量(例如MONO_HOME D:\ Mono with Path D:\ Mono \ bin)然后它工作了。没有一位导游说过这样做..