Search code examples
visual-studio-2012watin

File not found error when launching IE10 with WatiN 2.1 on Windows 8


In Visual Studio 2012, I created a Microsoft Unit Test project and added WatiN 2.1 via Nuget. When try to launch IE10 on Windows 8, I get file not found error.

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();
    }
}

Then, I realize the Copy Local for the following two dll are grayed out and set to false so I can't set it to Copy if newer.

Interop.SHDocVw.dll
Microsoft.mshtml.dll

I can manually copy them to the bin folder, but is there a problem with the Nuget package or my Visual Studio?


Solution

  • I found out that if I change the Embed Interop Types to False, then Copy Local becomes enabled.