The first step to solving your problem is finding out the reasons for the failure. After creating BrowserSharp according to your instructions (although I recreated csproj separately), I ran:
mono --debug BrowserSharp.exe
With the flag --debug mono will throw any unhandled exception:
Unhandled Exception: System.TypeInitializationException:
An exception was thrown by the type initializer for Gecko.WebControl --->
System.DllNotFoundException: gtkembedmoz.dll
at (wrapper managed-to-native) Gecko.WebControl: gtk_moz_embed_get_type ()
...
I could not find gtkembedmoz.dll in the Mono distribution, but it seems to be a separate installation. Link to link can be found here and some old, but possibly useful instructions.
I downloaded the stable GRE package and copied the gtkembedmoz.dll file to the build directory. It still crashed, so I checked the dependencies using depend.exe , in which it was clear that it lacked Gtk + libs. After installing gtk-sharp runtime and copying the missing DLLs to the assembly directory, I was able to run it using the Microsoft.NET runtime.
For some reason, it still didn't work with Mono. I suspect there is some difference in how Mono searches for unmanaged DLLs, but I have not considered this. Regardless of whether you use Mono from Microsoft.NET, you probably will not need to copy these DLLs to the assembly directory, it is just a matter of ensuring they are installed and configured correctly so that they are found.
Dave
source share