开发者

WCF discovery: Interface not found exception

I'm trying to use .net 4's discovery in WCF. But no matter what I do, I'm getting this not very useful exception:

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: 
 

(Stack trace is actually empty.)

Hitting "continue", the program chokes for a few seconds, then continues and displays correct results. This happens even in Microsoft's supplied WCF examples. I made sure that only unhandled exceptions are displayed in the exceptions window in VS 2010.

I've got no idea what might be causing this, especially considering 开发者_运维技巧the fact that the program does work perfectly except for short break caused by the exception.

The exception occurs in every project that uses Discovery, both those created by me and those supplied by Microsoft in the official WCF examples. It happens only on my machine, it works fine on my co-worker's box.

In my desperation I cross-posted at http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/8e326b48-232c-4510-8194-aa9d4ba36829


I was facing exactly the same problem with VS2015 update 3

What worked for me, was enabling the visual studio hosting process in the offending project properties, debug section

I tried toggling this checkbox a few times, and the behavior was consistent.


Problem solved.

I redownloaded the examples and reinstalled VS but I did that before and it did not change anything before. So I've got no clue as to what caused or fixed the issue. Good luck to anyone with the same problem in the future.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜