简体   繁体   English

GTK#+ WebKit + Windows

[英]GTK# + WebKit + Windows

I have developed a GTK# application that makes use of webkit-sharp to edit email templates. 我开发了一个GTK#应用程序,它使用webkit-sharp来编辑电子邮件模板。 This application works in Linux but when it is run in Windows it does not work. 此应用程序适用于Linux,但在Windows中运行时,它不起作用。 I am using the webkit-sharp.dll from Linux in Windows. 我在Windows中使用Linux中的webkit-sharp.dll。 The error that I am getting is: 我得到的错误是:

    System.TypeInitializationException: The type initializer for 'WebKit.WebView' threw an exception. ---> System.DllNotFoundException: Unable to load DLL 'webkit-1.0': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
   at WebKit.Download.webkit_download_get_type()
   at GtkSharp.WebkitSharp.ObjectManager.Initialize()
   at WebKit.WebView..cctor()
   --- End of inner exception stack trace ---
   at WebKit.WebView..ctor()
   at MainWindow..ctor()

I am guessing that webkit-sharp.dll only wraps the native libraries for WebKit. 我猜测webkit-sharp.dll只包装WebKit的本机库。 I do not know where to get "webkit-1.0". 我不知道从哪里得到“webkit-1.0”。 Is there a webkit-sharp.dll that is specific to Windows for GTK#? 是否存在特定于Windows for GTK#的webkit-sharp.dll?

I did exactly that. 我做到了那一点。 I guess the webkit windows dll does not use gtk as rendering engine. 我猜webkit windows dll不使用gtk作为渲染引擎。 What I did was install the libwebkit dll provided by the suse mingw32 port and all of its dependencies. 我所做的是安装suse mingw32端口及其所有依赖项提供的libwebkit dll。

You can see a full list of dependencies here 您可以在此处查看完整的依赖项列表

At the time of doing it(1 year ago more or less) the rendering was not perfect, but it may have improved. 在做这个时(1年前或多或少),渲染并不完美,但它可能有所改善。

I'm also having this problem... 我也有这个问题......

Not tried this, but at http://www.webkit.org/building/checkout.html 没试过这个,但是在http://www.webkit.org/building/checkout.html

The site suggests: 该网站建议:

  1. Download webkit support libraries 下载webkit支持库
  2. Run the update-webkit script 运行update-webkit脚本
  3. Build webkit from source 从源代码构建webkit

I think this requires cygwin installed. 我认为这需要安装cygwin。

I'm just paraphrasing the site - not tried this yet. 我只是在解释网站 - 还没试过这个。

Have you tried running the Hello World example app to make sure everything is set up correctly in your Windows environment? 您是否尝试运行Hello World示例应用程序以确保在Windows环境中正确设置了所有内容?

http://mono-project.com/Mono_Basics http://mono-project.com/Mono_Basics

You can also try some of the other example programs to make sure they function without error. 您还可以尝试其他一些示例程序,以确保它们正常运行而不会出错。

http://www.mono-project.com/GtkSharpBeginnersGuide http://www.mono-project.com/GtkSharpBeginnersGuide

Seems like a common installation issue requires the addition of an environment variable in windows to get the assemblies loaded correctly: 看起来像常见的安装问题需要在Windows中添加环境变量才能正确加载程序集:

http://www.mono-project.com/FAQ:_General#Installation_Problems http://www.mono-project.com/FAQ:_General#Installation_Problems

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM