WCF 测试客户端无法在 Windows 7 64 位上与 VS 2010 配合使用

标签 wcf visual-studio-2010 windows-7 64-bit wcftestclient

我无法使用 WCF 测试客户端。我总是收到以下错误。

Error: Cannot load reference assembly 'C:\Windows\Microsoft.Net\assembly\GAC_32\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll'    
Cannot load file C:\Windows\Microsoft.Net\assembly\GAC_32\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll as an Assembly. Check the FusionLogs for more Information.
Could not load file or assembly 'file:///C:\Windows\Microsoft.Net\assembly\GAC_32\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll' or one of its dependencies.
This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.

我在谷歌上找不到解决方案。我希望 stackOverflow hive Brain 能够提供帮助。

谢谢。

最佳答案

如果我没记错的话,您需要在 app.config 文件的 <configuration> 中添加运行时版本设置元素:

<startup>
  <requiredRuntime version="v4.0.30319" />
</startup>

关于WCF 测试客户端无法在 Windows 7 64 位上与 VS 2010 配合使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4998573/

相关文章:

java - 通过 Android 客户端连接到 WCF 服务

c# - 确定对不正确的 .NET Framework 版本的间接依赖的来源

windows-7 - 基于 OpenCV 相机的样本的问题

c# - 手动创建启用 JSON 的 WCF Svc 服务

c# - 如何配置 WCF 来处理大量并发用户?

visual-studio-2010 - 为什么 Visual Studio 2010 在从构建模式返回设计模式后会更改我的设计窗口位置?

visual-studio-2010 - 将现有文件夹添加到其他 Team Foundation Server 2012 已存在的 Team Foundation Server 2010

c - 使用 C 在 Windows 中强制按键或鼠标移动

git - 在 git shell 中运行批处理文件

wcf - 控制 WCF XmlSerializer