braydel / open-webkit-sharp

Automatically exported from code.google.com/p/open-webkit-sharp
GNU Lesser General Public License v3.0
0 stars 0 forks source link

Using OpenWebKitSharp from as referenced dll from SubFolder #143

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
following environment:

bin/mainapp.exe -> loads bin/mywebkitsharpcaller.dll -> references 
bin/MyOpenWebKitSharpFolder/OpenWebKitSharp.dll

bin/mainapp.exe.config contains a probing-path to find the webkit-dlls in 
subfolder:
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <probing privatePath="MyOpenWebKitSharpFolder"/>
</assemblyBinding>

mywebkitsharpcaller.dll sets WebKit.GlobalPreferences.WebKitPath before the 
WebKitBrowser-Instance is created.
WebKit.GlobalPreferences.WebKitPath += @"\" + m_sWebKitSubFolder;

when the webkitbrowser-instance is creating, im geetting this error message:

Die COM-Klassenfactory für die Komponente mit CLSID 
{D6BCA079-F61C-4E1E-B453-32A0477D02E3} konnte aufgrund des folgenden Fehlers 
nicht abgerufen werden: 8007007e Das angegebene Modul wurde nicht gefunden. 
(Ausnahme von HRESULT: 0x8007007E).

its german and means "the specified module could not be found". i got a lot of 
hits to this CLSID on google. but its allways just about the vc++ 
redistributables. when i copy all the webkit-files to my bin-folder, its 
working fine. so i guess the problem is not based on some runtime-issues.

i've tried it with 2.8 and 2.9 release

is there a recommended environment to run openwebkitsharp from a subfolder of 
the mainapp?

Original issue reported on code.google.com by wuhika...@gmail.com on 8 Oct 2012 at 8:00

GoogleCodeExporter commented 8 years ago
I am betting you are on Windows XP.

I am having the same problem with Windows XP, while on Windows 7 everything 
works out of box.
I've tried setting up dependantAssembly as following:
<dependentAssembly>
  <assemblyIdentity name="WebKit.Interop" publicKeyToken="b967213f6d29a3be" />
  <publisherPolicy apply="yes" />
  <bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="533.0.0.0" />
  <codeBase version="533.0.0.0" href="WebKit\WebKit.Interop.dll" />
</dependentAssembly>
<dependentAssembly>
  <assemblyIdentity name="WebKitBrowser" publicKeyToken="b967213f6d29a3be" />
  <publisherPolicy apply="yes" />
  <bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="0.5.0.0" />
  <codeBase version="0.5.0.0" href="WebKit\WebKitBrowser.dll" />
</dependentAssembly>

this doesn't work, as on Windows XP App looks for webkit.dll in App Folder, 
even if all assemblies are loaded from WebKit subfolder.

Also tried:
- forced loading of assemblies (preloading with Assembly.LoadFrom(...)):
  (XP) doesn't work, assembly is loaded again after with incorrect paths
  (W7) not tested, but I guess it doesn't work.

- forced loading of webkit.dll (calling function in webkit.dll forces loading 
of dll):
   (XP) webkit.dll and its dependecies are loaded properly, but again when referencing assembly is loaded webkit.dll is loaded from incorrect location
   (W7) not tested.

- SetDllDirectory() force location for webkit.dll and its files:
   (XP) can force loading of assembly but webkit.dll loading fails.
   (W7) not tested 

- Setting in Environment Path WebKit as member of path variable:
   (XP) can force loading of assembly but webkit.dll loading fails.
   (W7) not tested 

NOTE @MS: I thought DLL's are kept in memory, and not reloaded over and over 
again?

Original comment by niger...@gmail.com on 15 Oct 2013 at 12:15