【问题标题】:GTK# on windows 'libgtk-3-0.dll' could not be found无法找到 Windows 'libgtk-3-0.dll' 上的 GTK#
【发布时间】:2016-07-22 23:36:28
【问题描述】:

我刚刚在我的 windows 10 机器上从 mono 重新安装了 GTK#。我检查了我的 PATH 变量并确认引用了 C:\Program Files (x86)\GtkSharp\2.12。 Mono 已安装,我在 Visual Studio 和 xamarin Studio 中都收到以下错误。

无法加载 DLL 'libgtk-3-0.dll':指定的模块不能 成立。 (HRESULT 异常:0x8007007E)

这是我的申请

using System;
using Gtk;

namespace MyNamespace
{
    public static class Program
    {
        public static void Main()
        {
            Application.Init (); // breaks here

            var window = new Window ("Hello from Gtk#");

            window.Resize (200, 200);

            window.ShowAll ();

            Application.Run ();
        }
    }
}

我该如何解决这个问题?

【问题讨论】:

    标签: c# .net mono gtk# dllnotfoundexception


    【解决方案1】:

    我的项目引用了错误版本的 Gtk#。我删除了所有引用并重新添加了 gtk-sharp 2.12.0 和 glib-sharp 2.12.0。该程序现在按预期运行。

    【讨论】:

    • 在哪里删除和添加引用?
    • 在 Visual Studio 中,我使用了 nuget 包管理器(工具 → Nuget 包管理器 → 管理 ...)。在 MonoDevelop 和 Xamarin Studio 中,没有删除 nuget 包的选项,所以我右键单击项目 References 和 Packages 文件夹中的引用,然后单击 Remove。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-05-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多