We help IT Professionals succeed at work.
Get Started

Distributing an application that uses GeckoFX and XulRunner. DllNotFoundException.

Last Modified: 2016-01-30
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
        GeckoWebBrowser geckoBrowser;
        public Form1()

            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 );

Open in new window

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.
Watch Question
This problem has been solved!
Unlock 1 Answer and 1 Comment.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE