【问题标题】:Can't get Geckofx to work无法让 Geckofx 工作
【发布时间】:2014-07-08 15:18:39
【问题描述】:

如何在 Visual Studio 2013 中设置 GeckoFX?

我从https://bitbucket.org/geckofx/geckofx-29.0/downloads 下载了GeckoFS 文件,并尝试将Geckofx-Core.dllGeckofx-Winforms.dll 添加到c# 中的组件。那行得通,我在表单中创建了一个浏览器,但是在运行它时出现了这个错误:

An unhandled exception of type 'System.DllNotFoundException' occurred in Geckofx-Core.dll

Additional information: Unable to load DLL 'xul': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

我尝试将各种版本的xulrunner 添加到项目中,例如版本 22 和 29,但这并没有消除错误。

我想做的只是制作一个简单的 Windows 窗体应用程序,该应用程序使用最新的 GeckoFx-29 打开 GeckoFX 浏览器。

【问题讨论】:

    标签: c# xulrunner gecko geckofx


    【解决方案1】:

    首先,您需要下载 xulrunner 29 或 Firefox 29。

    当路径是安装的xulrunner 29或Firefox 29的文件夹时,您需要调用Xpcom.Initialize(path)

    例如,如果您将 Firefox 29 安装到“c:\program Files x86\Mozilla Firefox\”

    然后你会打电话给Xpcom.Initialize(@"c:\program Files x86\Mozilla Firefox\")

    这告诉 geckofx 在哪里可以找到 xul.dll。

    然后你就可以在你的 winforms 应用程序中使用 GeckoWebBrowser 控件了。

    注意 - 您还应确保 Main 入口点具有 [STAThread] 属性。

    【讨论】:

      【解决方案2】:

      在我的情况下,这个错误是因为我在Form1_Load 函数中初始化了xulrunner。我通过在 public Form1() 函数中初始化 xulrunner 来解决它。

      【讨论】:

        猜你喜欢
        • 2014-10-02
        • 1970-01-01
        • 2020-02-23
        • 2014-12-26
        • 2017-12-22
        • 2012-02-28
        • 2015-12-01
        • 2012-01-29
        • 2014-12-16
        相关资源
        最近更新 更多