WPF 内嵌 Gecko的相关异常处理

这篇博客主要介绍了在WPF应用中使用GeckoFX时遇到的异常及解决办法,包括DllNotFoundException、FileLoadException和BadImageFormatException。针对这些问题,解决方案分别是安装vcredist,解锁被锁定的dll文件,修改系统区域设置为中文简体,以及在项目设置中取消首选32位的选项。
摘要由CSDN通过智能技术生成

1、DllNotFoundException
System.DllNotFoundException: Unable to load DLL ‘mozglue’: The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at Gecko.Xpcom.Alloc(IntPtr size)
at Gecko.nsAString…ctor() in D:\temp\0104592\Geckofx-Core\nsString.cs:line 883
at Gecko.nsAString…ctor(String value) in D:\temp\0104592\Geckofx-Core\nsString.cs:line 895
at Gecko.Xpcom.Initialize(String binDirectory) in D:\temp\0104592\Geckofx-Core\Xpcom.cs:line 324
。。。(这里是对应调用Gecko的项目文件,可以忽略)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

初始化Xpcom.Initialize(“Firefox”);报错

尝试重装vredist,以上问题解决
下载地址
https://www.microsoft.com/en-us/download/details.aspx?id=48145

2、
错误的程序集:。。。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值