.net WCF发现:未找到接口异常

.net WCF发现:未找到接口异常,.net,wcf,discovery,.net,Wcf,Discovery,我试图在WCF中使用.NET4的发现。但无论我做什么,我都会得到一个不太有用的例外: System.ArgumentException crossed a native/managed boundary Message=Interface not found. Source=mscorlib StackTrace: at System.RuntimeTypeHandle.VerifyInterfaceIsImplemented(RuntimeTypeHandle han

我试图在WCF中使用.NET4的发现。但无论我做什么,我都会得到一个不太有用的例外:

System.ArgumentException crossed a native/managed boundary Message=Interface not found. Source=mscorlib StackTrace: at System.RuntimeTypeHandle.VerifyInterfaceIsImplemented(RuntimeTypeHandle handle, RuntimeTypeHandle interfaceHandle) at System.RuntimeType.GetInterfaceMap(Type ifaceType) at Microsoft.VisualStudio.Diagnostics.ServiceModelSink.ServiceMethodResolver.ResolveMethodInfo(Type implementationType, MethodInfo contractMethod) at Microsoft.VisualStudio.Diagnostics.ServiceModelSink.ServiceMethodResolver..ctor(ContractDescription contract, DispatchRuntime runtime, Message request, InstanceContext instanceContext) InnerException: System.ArgumentException跨越了本机/托管边界 Message=未找到接口。 Source=mscorlib 堆栈跟踪: 在System.RuntimeTypeHandle.VerifyInterfaceIsImplemented(RuntimeTypeHandle句柄,RuntimeTypeHandle接口句柄) 在System.RuntimeType.GetInterfaceMap(类型ifaceType) 位于Microsoft.VisualStudio.Diagnostics.ServiceModelSink.ServiceMethodResolver.ResolveMethodInfo(类型implementationType,MethodInfo contractMethod) 位于Microsoft.VisualStudio.Diagnostics.ServiceModelSink.ServiceMethodResolver..ctor(契约描述契约、DispatchRuntime运行时、消息请求、InstanceContext InstanceContext) 内部异常: (堆栈跟踪实际上是空的。)

点击“继续”,程序将阻塞几秒钟,然后继续并显示正确的结果。甚至在Microsoft提供的WCF示例中也会发生这种情况。我确保在VS2010中,只有未处理的异常才会显示在异常窗口中

我不知道是什么原因导致了这种情况,特别是考虑到这个程序除了由异常引起的短暂中断之外工作得很好这一事实

在使用Discovery的每个项目中都会出现异常,包括我创建的项目和Microsoft在官方WCF示例中提供的项目。它只发生在我的机器上,在我同事的盒子上运行良好

在我绝望的时候,我把问题解决了


我重新下载了这些示例并重新安装了VS,但我以前这么做过,它以前没有做任何更改。所以我不知道是什么导致或修复了这个问题。祝将来有同样问题的人好运。

我在VS2015更新3中遇到了完全相同的问题

对我有效的是

我试着切换了几次这个复选框,行为是一致的