在Windows 8上使用WatiN 2.1启动IE10时发现文件未找到错误

时间:2012-09-26 02:21:58

标签: visual-studio-2012 watin

在Visual Studio 2012中,我创建了一个Microsoft Unit Test项目,并通过Nuget添加了WatiN 2.1。 当尝试在Windows 8上启动IE10时,我发现找不到文件错误。

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.

[TestClass]
public class UnitTest1
{
    [TestMethod]
    public void TestMethod1()
    {
        var driver = new IE("http://google.com");
        driver.Close();
    }
}

然后,我意识到以下两个dll的Copy Local显示为灰色并设置为false,因此我无法将其设置为Copy if newer

Interop.SHDocVw.dll
Microsoft.mshtml.dll

我可以手动将它们复制到bin文件夹,但是Nuget包或我的Visual Studio有问题吗?

1 个答案:

答案 0 :(得分:0)

我发现如果我将Embed Interop Types更改为False,那么Copy Local就会启用。

相关问题