Question

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.

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

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

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.

Was it helpful?

Solution

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.

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.

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top