c# - WatiN 引用的程序集错误

标签 c# reference console assemblies watin

我正在尝试让这个基本的 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/

相关文章:

c++ - 我如何通过引用将一个 C++ 字符串分配给另一个字符串

c# - 添加对控制台应用程序的 Web 服务引用

c# - 如何设置 radcombobox 元素的样式以便换行的单词分开

c# - 带有内部连接的 SQL Server NULL 值

java - 使用 Java 中的引用来创建副作用

C++ - 引用成员的默认初始化 - 这甚至如何工作?

c# - 我的 C# 程序出现错误 "The process tried to write to a nonexistent pipe"

c - 无论如何,我不能在我的 Eclipse 中使用 fflush 来获得正确的控制台?

Azure DevOps 中带有图像的 C# NuGet 包错误

c# oledb 异常数据类型不匹配发生在选择查询中