WatiN System.IO.FileNotFoundException Interop.SHDocVw

发布于 2024-10-26 04:48:07 字数 770 浏览 3 评论 0原文

在运行 WatIn 测试时,我刚刚开始收到以下错误。

System.IO.FileNotFoundException:无法加载文件或程序集 'Interop.SHDocVw,版本=1.1.0.0,文化=中性, PublicKeyToken=db7cfd3acb5ad44e' 或其依赖项之一。这 系统找不到指定的文件。

我在网上搜索并尝试了以下解决方案,但均无效。

有人可以帮忙吗?

I have just started to receive the following error when running my WatIn tests.

System.IO.FileNotFoundException : Could not load file or assembly
'Interop.SHDocVw, Version=1.1.0.0, Culture=neutral,
PublicKeyToken=db7cfd3acb5ad44e' or one of its dependencies. The
system cannot find the file specified.

I have searched the web and tried the following solutions, none of which work.

Can anyone assist?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

纸伞微斜 2024-11-02 04:48:07

您是否尝试过以下操作:

转到解决方案资源管理器,单击互操作 dll,在属性中将“嵌入互操作类型”更改为 FALSE。

最好使用 .net studio 的 NuGet 插件,然后通过“添加库包引用”添加对 wattin 的引用。

Have you tried this:

Go to solution explorer, click on the interop dll, in properties change "Embed Interop types" to FALSE.

Best to use NuGet addon for .net studio and then add reference to wattin via "Add Library Package Reference".

蓝天白云 2024-11-02 04:48:07

Interop.SHDocVw、Microsoft.mshtml dll 的 Embed Interop Types 属性设置为 False

当然,Visual Studio 会向您发出如何修改的警告。

Setting the Interop.SHDocVw, Microsoft.mshtml dlls' Embed Interop Types property to False;

Off course Visual Studio would give you warnings on how to ammend.

风筝在阴天搁浅。 2024-11-02 04:48:07

我遇到了这个问题,并通过手动将 Interop.ShDocVw.dll 添加到输出目录中来解决它。

I had this problem and got around it by manually adding the Interop.ShDocVw.dll into the output directory.

⊕婉儿 2024-11-02 04:48:07

我总是最终重新编译 watin,因此它没有签名,因为我也无法使任何建议的解决方案起作用。

您可以在此处获取源代码: http://watin.org/

在 \source\src 文件夹中打开解决方案 (有VS2008和VS2010版本),打开两个项目并转到属性->签名,取消选中“签署程序集”,然后构建解决方案。

您应该在 \source\src\Core\bin 中获得两个 DLL(WatiN.Core.dll 和 Interop.SHDocVw.dll) - 只需将它们复制到您的项目中,它们就应该可以正常工作。

I always end up recompiling watin so it isn't signed, as I couldn't make any of the suggested solutions work either.

You can get the source here: http://watin.org/

Open the solution in the \source\src folder (there are VS2008 and VS2010 versions), open both projects and go properties -> Signing, uncheck 'sign the assembly', and build the solution.

You should get two DLLs in \source\src\Core\bin (WatiN.Core.dll and Interop.SHDocVw.dll) - just copy these into your project and they should work Ok.

如何视而不见 2024-11-02 04:48:07

您需要 Watin 附带的 Interop.ShDocVw.dll 文件,您可能需要将其添加到您的 Visual Studio 解决方案中,或者添加到与 Watin dll 相同的目录(如果该目录尚不存在)。如果您确实拥有它,请确保您拥有正确的版本。

You need the Interop.ShDocVw.dll file that should have come with Watin, you might have to add it to your visual studio solution or to the same directory as the Watin dll's if it's not already there. In the case that you do have it make sure that you have the correct version.

魂归处 2024-11-02 04:48:07

如果您使用 Visual Studio TestTools,则应该设置 DeploymentAttribute 来解决此问题。

例子:

[DeploymentItem( @"your_path\Interop.SHDocVw.dll" )]
public class WatinTestSuite {

... 

}

If you are using the Visual Studio TestTools you should set the DeploymentAttribute to solve this Problem.

Example:

[DeploymentItem( @"your_path\Interop.SHDocVw.dll" )]
public class WatinTestSuite {

... 

}
ぇ气 2024-11-02 04:48:07

就我而言,我尝试了所有建议的解决方案,但没有成功。我最终以管理员权限关闭并重新打开 Visual Studio 2015,然后解决方案编译成功。

希望它能帮助某人。

In my case, I tried all of the suggested solutions and it did not work. I ended up closing and reopening Visual Studio 2015 with admin privileges, and then the solution compiled successfully.

Hope it helps someone.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文