今天在 Visual Studio 2008 调试一 WCF 项目时候,忽然弹出如下错误:
Unable to automatically debug ‘xxx’. The remote procedure could not be debugged. This usually indicates that debugging has not been enabled on the server.
按网上很多朋友说的,设置 WCF 的 web.config 中 compilation 的 debug=”true”,但已经是 true 了。更奇怪的是记得以前都没有问题,今天才出现。
按 Solved: Unable to automatically step into the server. The remote procedure could not be debugged… 的方法,将调用 WCF 的 WinForm 项目的平台目标改为 x86(选择项目,右击,选择属性),竟然真的可以。
原来另一个团队成员在该 WinForm 引用一个第三方的 dll,这个 dll 直接编译成了 x86 。也不知道内部什么原因竟然导致 WinForm 可以调试,但远程的 WCF 却无法调试,真是诡异。