Avatar of CaptainGiblets
CaptainGiblets
Flag for United Kingdom of Great Britain and Northern Ireland asked on

Distributing an application that uses GeckoFX and XulRunner. DllNotFoundException.

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()
        {
            InitializeComponent();

            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.
.NET ProgrammingC#

Avatar of undefined
Last Comment
CaptainGiblets

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
CaptainGiblets

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes