[MonoDevelop] Using Gecko.WebControl

Michael Hutchinson m.j.hutchinson at gmail.com
Mon Mar 3 00:14:41 EST 2008


On Sun, Mar 2, 2008 at 10:01 AM, Paulo Aboim Pinto
<esqueleto at tusofona.com> wrote:
> I made a small application that use the control Gecko.WebControl to open
> some WebSite. When I run using MonoDevelop everything goes well, but when I
> try to run the exe file using the command: $ mono <application>.exe I get
> this error:
>
> Unhandled Exception: System.TypeInitializationException: An exception was
> thrown by the type initializer for Gecko.WebControl --->
> System.DllNotFoundException: /usr/lib/firefox/libgtkembedmoz.so

I agree, this is confusing because the DllNotFoundException has the
full path to the .so file (from an Ubuntu DllMap I'd guess). However,
full paths don't (always?) seem to work with DllImports. You need to
add /usr/lib/firefox to the LD_LIBRARY_PATH environment variable
before you start the app so that the dynamic linker can find the
library.

<....>
> why!?!?
> I just get this error when I run using the console. The file
> libgtkembedmoz.so is on the place to be find:
>
> $ ll /usr/lib/firefox/libgtkembedmoz.so
> -rw-r--r-- 1 root root 79K 2008-02-07 11:08
> /usr/lib/firefox/libgtkembedmoz.so
>
>
> what I'm doing wrong??

The reason that is works from within MonoDevelop is that MD sets the
LD_LIBRARY_PATH for GtkMozEmbed already in its own launch script. If
you look in the MD launch script you can find some nice Gecko
autodetection code that you're welcome to use...

-- 
Michael Hutchinson
http://mjhutchinson.com


More information about the Monodevelop-list mailing list