RyPope
RyPope

Reputation: 2715

WebKit.NET with C# Project Runtime Exception

I have downloaded WebKit.NET 0.5-bin-cairo to work with an existing C# Project. I've included WebKitBrowser.dll and WebKit.Interop.dll as a reference to the module that requires it, as well as playing them directly in the debug/bin folder as directly by this tutorial.

I do not get any errors until I run the project and get an exception on this line in InitializeComponent() of the designer class.

this.webKitBrowser1 = new WebKit.WebKitBrowser();

The exception:

An unhandled exception of type 'System.ComponentModel.Win32Exception' occurred in WebKitBrowser.dll

Additional information: Failed to initialize activation context

I am building all the modules as 86x debug and my computer is 64 bit.

Any suggestions are appreciated as I've been playing around with this for multiple days.

Upvotes: 5

Views: 6216

Answers (2)

Chaturvedi Dewashish
Chaturvedi Dewashish

Reputation: 1469

I had encountered same issue. Three things were missing in my scenario.

  1. manifest files: must be placed as all dlls are dynamically linked
  2. VC++ must be installed on machine: In my case I used vc++2005 redistributable sp1.
  3. Not only dlls/pdb/manifest you need to copy all the folders to root directory of executable

There is no correct packaging available yet for all files/folders of webkit.NET And obviously project architecture should be x86 for all projects referencing webkit dlls

Upvotes: 5

Mystra007
Mystra007

Reputation: 275

Have you tried: WebKit.Net and OpenWebKitSharp Error: Failed to initialize activation context ? Namely to copy all the files from Core(not just the dlls) into your project /bin/release/ or /bin/debug/ folder?

quoted from the tutorial you followed: Before we can run the application, WebKit.dll and it's dependencies must be present in the output directory. In Windows Explorer (or otherwise), copy all of the files from the WebKit .NET 'bin' directory to your project's output directory. For example, here is the listing of my output directory after copying:

D:\webkitdotnet\WebKitTest\WebKitTest\bin\Debug>ls   
CFLite.dll                      icudt40.dll          
JavaScriptCore.dll              icuin40.dll          
JavaScriptCore.resources        icuuc40.dll          
SQLite3.dll                     libcurl.dll          
WebKit.Interop.dll              libcurl.dll.manifest 
WebKit.dll                      libeay32.dll         
WebKit.resources                libeay32.dll.manifest
WebKitBrowser.dll               libpng13.dll         
WebKitBrowser.dll.manifest      libxml2.dll          
WebKitBrowser.pdb               libxslt.dll          
WebKitTest.exe                  pthreadVC2.dll       
WebKitTest.pdb                  ssleay32.dll         
WebKitTest.vshost.exe           ssleay32.dll.manifest
WebKitTest.vshost.exe.manifest  zlib1.dll            
curl.exe.manifest

You mentioned you only copied WebKitBrowser.dll and WebKit.Interop.dll over

Upvotes: 1

Related Questions