2012-09-26 34 views
1

在Visual Studio 2012中,我創建了一個Microsoft單元測試項目,並通過Nuget添加了WatiN 2.1。 當試圖在Windows 8上啓動IE10時,出現文件未找到錯誤。在Windows 8上使用WatiN 2.1啓動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(); 
    } 
} 

然後,我意識到Copy Local爲以下兩個DLL將顯示爲灰色,並設置爲false,所以我不能將其設置爲Copy if newer

Interop.SHDocVw.dll 
Microsoft.mshtml.dll 

我可以手動將它們複製到bin文件夾,但是Nuget包或我的Visual Studio有問題嗎?

回答

0

我發現如果我將Embed Interop Types更改爲False,則Copy Local變爲啓用。

相關問題