Micro
Micro

Reputation: 10891

Can't get Geckofx to work

How do I set up GeckoFX in Visual Studio 2013?

I downloaded the GeckoFS files from https://bitbucket.org/geckofx/geckofx-29.0/downloads and tried to add Geckofx-Core.dll and Geckofx-Winforms.dll to components in c#. That worked and I created a browser in a form but when running it I got this error:

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)

I tried adding various versions of xulrunner to the project like version 22 and 29 but that didn't remove the error.

All I would like to do is make a simple windows form application that opens a GeckoFX browser using the latest GeckoFx-29.

Upvotes: 0

Views: 11600

Answers (2)

arunjos007
arunjos007

Reputation: 4355

In my case this error is caused because of I initialised xulrunner in Form1_Load function. I resolved it by initialising xulrunner in public Form1() function.

Upvotes: 0

Tom
Tom

Reputation: 6719

Firstly you need to download either xulrunner 29 or Firefox 29.

The you need to call Xpcom.Initialize(path) when path is the folder of the installed xulrunner 29 or Firefox 29.

For example If you installed Firefox 29 to "c:\program Files x86\Mozilla Firefox\"

Then you would call Xpcom.Initialize(@"c:\program Files x86\Mozilla Firefox\")

This tells geckofx where to find xul.dll.

Then you can use the GeckoWebBrowser control in your winforms application.

Note - you should also ensure that your Main entry point has the [STAThread] attribute.

Upvotes: 2

Related Questions