Tag: discovery

有没有办法在单声道中使用WCF Discovery?

我正在尝试让WCF Discovery在单声道3.2.8中工作。 单声道网页提到了许多Discovery行为应该存在,但我无法通过代码设置或App.config设置来使其工作。 这在.net中100%有效,所以我知道至少原则是正确的。 这类似于未解决的问题: WCF Udp Discovery in mono 但是,我的具体问题是:有没有办法在单声道中使用WCF Discovery? App.config安装程序提供此错误: [ERROR] FATAL UNHANDLED EXCEPTION: System.Configuration.ConfigurationErrorsException: Error deserializing configuration section behaviors: Invalid element in configuration. The extension name ‘serviceDiscovery’ is not registered in the collection at system.serviceModel/extensions/behaviorExtensions 代码设置会出现此错误: System.InvalidOperationException: Contract ‘TargetService’ is not implemented in this service ‘MyService’ 如果需要,我可以提供代码,但由于我要求另一种有效的方法,我不相信它在这一点上是必需的。 如果您在4.5中引用Mono System.ServiceModel.Discovery – 您会注意到CreateBehavior()上有一个NotImplemented图标(位于:System.ServiceModel.Discovery.Configuration.ServiceDiscoveryElement),这似乎是我的问题的根本原因。