WatiN 错误无法加载程序集 [英] WatiN Error Could not Load Assembly
问题描述
我收到以下 WatiN 错误:
I am getting the following WatiN error:
未处理的异常:System.IO.FileLoadException:无法加载文件或汇编 'Interop.SHDocVw, Version=1.1.0.0, Culture=neutral,PublicKeyToken=db7cfd3acb5 ad44e' 或其依赖项之一.这定位的程序集的清单定义与程序集不匹配参考.(来自 HRESULT 的异常:0x80131040)文件名:'Interop.SHDocVw,版本=1.1.0.0,文化=中性,PublicKeyToken=db
Unhandled Exception: System.IO.FileLoadException: Could not load file or assembl y 'Interop.SHDocVw, Version=1.1.0.0, Culture=neutral, PublicKeyToken=db7cfd3acb5 ad44e' or one of its dependencies. The located assembly's manifest definition do es not match the assembly reference. (Exception from HRESULT: 0x80131040) File name: 'Interop.SHDocVw, Version=1.1.0.0, Culture=neutral, PublicKeyToken=db
我将 shDocvw.dll 从 System32 复制到 bin 目录,但它仍然给我同样的问题.
I copied the shDocvw.dll from System32 to the bin directory but still it is giving me the same problems.
推荐答案
更新:此答案是在 Nuget 发布之前编写的,仅适用于您不使用 Nuget 管理依赖项的情况.正在使用 Nuget 查看@Nick Jones 的答案
UPDATE: This answer was written before Nuget was released and applies only if you are NOT using Nuget to manage your dependencies. If you are using Nuget see the answer by @Nick Jones
我今天刚遇到这个问题.您需要下载最新版本的 WatiN(我使用的是 2.0.10.928)并引用由 WatiN 提供的已签名的 Interop.SHDocVw.dll.
I just had this issue today. You need to download the latest version of WatiN (I'm using 2.0.10.928) and reference the signed Interop.SHDocVw.dll that is provided by WatiN.
尝试以下操作:
- 删除对 Interop.SHDocVw.dll 的所有其他引用
- 右键单击您的解决方案并选择清洁解决方案"
- 参考 WatiN 提供的 Interop.SHDocVw.dll
- 构建您的解决方案.
希望这会有所帮助.
更新: 尼克琼斯是正确的.如果您使用的是 NuGet,这 应该 不是问题......但是我在使用 MvcContrib.Mvc3.TestHelper-ci 时也收到了这条消息.乍一看 似乎'-ci' 包是要走的路,但我决定使用 MvcContrib.WatiN 包有两个原因.
UPDATE: Nick Jones is correct. This should not be an issue if you are using NuGet....but I was also getting this message when using MvcContrib.Mvc3.TestHelper-ci. At first glance it seems like the '-ci' packages is the way to go but I decided to use the MvcContrib.WatiN package for two reasons.
1) 我没有收到无法加载文件或程序集"错误消息
1) I don't get the "Could not load file or assembly" error message
2) MvcContrib.Mvc3.TestHelper-ci 是使用旧版本的WatiN.Core.dll (1.3.0.4000) 其中 MvcContrib.WatiN 包使用的是较新版本 (2.0.0.99)
2) The MvcContrib.Mvc3.TestHelper-ci is using an old version of WatiN.Core.dll (1.3.0.4000) where as the MvcContrib.WatiN package is using a newer version (2.0.0.99)
这篇关于WatiN 错误无法加载程序集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!