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.
LVL 6
CaptainGibletsAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

CaptainGibletsAuthor Commented:
Currently putting out the application by copying the bin directory and creating a shortcut to the .exe within, but this isn't an ideal solution.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.