我正在尝试让这个基本的 Watin 控制台应用程序正常工作,但是我遇到了以下错误:
"Warning 1 The referenced assembly "WatiN.Core" could not be resolved because it has a dependency on "System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which is not in the currently targeted framework ".NETFramework,Version=v4.0,Profile=Client". Please remove references to assemblies not in the targeted framework or consider retargeting your project. consoletest"
我已确保将 STAThread] 属性应用于主要方法 as they recommend.
这是项目的屏幕截图:Link
补充说明: 我安装了最新版本的 watin (2.1) 和 我设法让一个类似的应用程序作为 Windows 类文件运行,但需要能够直接运行这个应用程序并查看输出,所以这就是我制作 Windows 控制台应用程序的原因。
任何帮助将不胜感激谢谢:)
最佳答案
有完全相同的问题。
做过这个:
右键单击该项目。
去 build
将下拉列表中的“Targe Framework”从 .Net 4.0 目标客户端更改为 .Net 4.0
然后它开始工作。
希望这会有所帮助。
关于c# - WatiN 引用的程序集错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9748267/