views:

447

answers:

3

Hi,

I'm working on a .NET WinForms application that loads forms and other UI elements from separate assemblies at runtime. This works well.

However, one of the assemblies I'm loading has a form that uses either GeckoFX or WebKit.NET to embed a web browser control. When I try to load that assembly with Assembly.CreateInstance() I'm getting an exception saying that it can't find the assembly I'm trying to load, even though it's there. Everything builds fine and a separate test application with a normal build / link works fine with these controls.

Any ideas here?

Thanks,

Matt

A: 

Make sure that all of the dependencies are locatable, as well as the assembly you are trying to load.

If you do that, you should be able to use either assembly just fine.

Reed Copsey
Thanks Reed. When you say "locatable", what exactly does that mean? Same location as the other binaries? For GeckoFX and WebKit.NET there are many many binaries since they depend on the runtime engines for those browsers.
Matt Culbreth
Windows has a well-defined way of searching for a DLL. It needs to find the assembly (GeckoFX.dll or WebKit.NET.dll) as well as all of the runtime binaries. See: http://msdn.microsoft.com/en-us/library/7d83bc18(VS.80).aspx
Reed Copsey
+2  A: 

You can try using Fusion Log Viewer to find which dependency is not loading. This assumes the dependency is a .NET assembly which is not being loaded. If it is a assembly missing via P/Invoke it will be more complicated.

GrayWizardx
A: 

This can happen in 2 conditions

  1. For geckofx, you dont have xulrunner in your system, you need to add this line in your code to load xulrunner - Skybound.Gecko.Xpcom.Initialize(@"path to xulrunner");

  2. If you are on a 64 bit machine, then you will get an exception, you need to build it for 32 bit version.

Sumit Ghosh