[英]Can't install Watin for Visual Studio
I want to install Wating for Visual Studio 2010. I saw their Video on the website, and followed the steps, but I got some errors while installing NuGet. 我想安装Wating for Visual Studio2010。我在网站上看到了他们的视频,并按照步骤操作,但是在安装NuGet时遇到一些错误。
This is what I did now: 这就是我现在所做的:
And I get this errors: 我得到这个错误:
'Form' is an ambiguous reference between 'System.Windows.Forms.Form' and 'WatiN.Core.Form' 'WatiN.Core.Form' does not contain a constructor that takes 0 arguments The name 'Assert' does not exist in the current context “ Form”是“ System.Windows.Forms.Form”和“ WatiN.Core.Form”之间的模棱两可的引用。“ WatiN.Core.Form”不包含带有0个参数的构造函数。名称“ Assert”在其中不存在目前的情况
Here is my application code (I added using Watin.Core too): 这是我的应用程序代码(我也是使用Watin.Core添加的):
private void Form1_Load(object sender, EventArgs e)
{
using (var browser = new IE("http://www.google.com"))
{
browser.TextField(Find.ByName("q")).TypeText("WatiN");
browser.Button(Find.ByName("btnG")).Click();
Assert.IsTrue(browser.ContainsText("WatiN"));
}
}
What do you think ? 你怎么看 ?
The problem is that both System.Windows.Forms
and WatiN.Core
contain definitions of Form
class. 问题在于
System.Windows.Forms
和WatiN.Core
都包含Form
类的定义。 My suggestion is to delete both(one of) the references to WatiN.Core
and System.Windows.Forms
and manually resolve the issues like so: 我的建议是删除对
WatiN.Core
和System.Windows.Forms
的引用(之一),并手动解决以下问题:
System.Windows.Forms.Form form = new System.Windows.Forms.Form();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.