我从 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 客户端配置文件。
你想要这张图片中的另一个。
关于c# - 无法在 C# 2010 中引用 moq.dll,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7637489/