I am trying to implement a browser control in my application that uses FireFox instead of the usual IE WebBrowser control, and so far have succeeded in building and running my application using the GeckoWebBrowser in a Windows Forms Application.
My issue comes when I try to distribute the application. Installing and running the application from the publish location causes an exception when trying to use the GeckoWebBrowser control:
System.DllNotFoundException: Unable to load DLL 'xul': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
I used NuGet to grab GeckoFX and XulRunner, but have also attempted to implement them separately myself and ran into the same issue.
I use ClickOnce Security and Deployment to publish my application to a server location where anyone can run the setup.
It looks like the XUL.dll is not being deployed as a part of the application. I have tried storing the XUL.dll in a shared location and pointing the application to that directory, but even in debug the following ComException occurs and I cannot progress:
Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))
Here's the full source for my little test application:
public partial class Form1 : Form
geckoBrowser = new GeckoWebBrowser();
//Gecko.Xpcom.Initialize( @"L:\Databases\Applications\xulrunner\" );
Gecko.Xpcom.Initialize( Path.GetDirectoryName( Assembly.GetEntryAssembly().Location ) );
geckoBrowser.Dock = DockStyle.Fill;
this.Controls.Add( geckoBrowser );
private void btnGo_Click( object sender, EventArgs e )
geckoBrowser.Navigate( txtAddress.Text );
I am unsure as to how to progress from here.
Am I on the right track trying to make XulRunner available in a public location, or do I need to change how I distribute the application?
Is the issue as simple/frustrating as it seems or am I on the wrong track entirely?
Thanks for the assist.