c# - 无法在 C# 2010 中引用 moq.dll

标签 c# visual-studio-2010 moq

我从 www.code.google.com/p/moq 下载了 Moq.4.0.10827,并尝试将对 Moq.4.0.10827\NET40\Moq.dll 的引用添加到 Visual Studio 2010 C# 项目中。尝试构建此项目时,我看到此警告:

The referenced assembly "Moq, Version=4.0.10827.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL" 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.

无法识别 Moq 命名空间,构建失败。这怎么能解决?

最佳答案

将项目更改为不在项目属性中使用 .NET 4 客户端配置文件。

你想要这张图片中的另一个。

enter image description here

关于c# - 无法在 C# 2010 中引用 moq.dll,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7637489/

相关文章:

c# - 如何检查exe的版本兼容性?

c# - 关于接口(interface)实现和可扩展性的架构问题

C# 编译器优化和 volatile 关键字

c++ - 在某些静态库中打开整个程序优化会显着增加库的大小!

c# - 有没有办法从 C# 代码中修改 Visual Studio 2008 或 2010 项目预构建事件?

visual-studio-2010 - 为什么不通过 umbraco admin 创建的文档类型创建为 .cs 文件

c# - 如何最小起订量 Amazon MWS 的响应以进行单元测试

Nuget 找不到更新的依赖项

c# - 我可以在 Linux 中编译 .net Core 3 WPF 应用程序吗?

c# - ASP.NET Core Controller 中的模拟 HttpRequest