有没有办法在单声道中使用WCF发现? [英] Is there any way to use WCF Discovery in mono?

查看:85
本文介绍了有没有办法在单声道中使用WCF发现?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试让WCF Discovery在Mono 3.2.8中工作.单声道网页提到很多发现"行为都应该存在,但是我无法通过代码设置或App.config设置使其正常工作.这在.net中100%有效,因此我知道至少这些原则是正确的.

I'm trying to get WCF Discovery to work in mono 3.2.8. The mono web page mentions that a lot of the Discovery behavior should be there, but I can't get it to work via code set up or App.config setup. This works 100% in .net, so I know that at least the principles are correct.

这类似于以下问题的未解答问题: 单声道中的WCF Udp发现

This is similar to the unanswered question at: WCF Udp Discovery in mono

但是,我的具体问题是:是否有任何在单声道中使用WCF Discovery的方式?

but, my specific question is: Is there any way of using WCF Discovery in mono?

App.config安装程序出现此错误:

App.config setup gives this error:

[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

代码设置会出现此错误:

Code setup gives this error:

System.InvalidOperationException: Contract 'TargetService' is not implemented 
in this service 'MyService'

我可以根据需要提供代码,但是由于我正在寻求另一种可行的方法,因此我认为目前不需要.

I can provide the code if needed, but since I'm asking for another way that works I don't believe it's needed at this point.

如果您引用

If you reference Mono System.ServiceModel.Discovery in 4.5 - you'll note that there is a NotImplemented icon on CreateBehavior() (located at: System.ServiceModel.Discovery.Configuration.ServiceDiscoveryElement) which seems to be the root cause of my issue.

推荐答案

我正在为同一个问题苦苦挣扎.我已经尝试了多种方法,但是我也无法使它起作用.我认为您已经找到了问题的根本原因,未实现CreateBehavior().

I am struggling with the same problem. I've tried a number of approaches, but I can't get it to work either. I think you've got to the root cause of the problem with CreateBehavior() being not implemented.

我确实为我的应用程序创建了一个变通方法,尽管它不像纯WCF解决方案那么干净.使用mono项目的 Zeroconf 实现来发布服务,然后在客户端上进行浏览(再次与zeroconf一起)为我工作.找到服务后,我使用zeroconf结果创建我的WCF代理.

I did create a work-around for my application, although it's not as clean as a pure WCF solution. Using the mono project's Zeroconf implementation to publish the service and then browse for it on the client side (again with zeroconf) worked for me. After finding the service, I use the zeroconf results to create my WCF proxy.

我的用法是为同一子网上的内部客户端提供内部服务,这使得此实现相对容易.我不确定它是否/如何跨子网工作,但是根据零配置网络:权威指南"(Cheshire,Seienberg),可以做到.

My use for this is an internal service for internal clients on the same subnet, which makes this implementation relatively easy. I'm not sure if/how it works across subnets, but according to "Zero Configuration Networking: the Definitive Guide" (Cheshire, Seienberg), it can be done.

这篇关于有没有办法在单声道中使用WCF发现?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆