Bug 14070 - WCF Udp Discovery in mono
Summary: WCF Udp Discovery in mono
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: WCF assemblies ()
Version: unspecified
Hardware: PC Linux
: Lowest normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2013-08-19 08:41 UTC by nesvarbu
Modified: 2016-03-09 15:47 UTC (History)
4 users (show)

Tags: mono-community
Is this bug a regression?: ---
Last known good build:

Simple code example to reproduce problem. (1.45 KB, text/plain)
2013-08-19 08:41 UTC, nesvarbu

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report for Bug 14070 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

Description nesvarbu 2013-08-19 08:41:35 UTC
Created attachment 4657 [details]
Simple code example to reproduce problem.

Description of Problem:
Can't enable WCF discovery using mono framework. I was following http://msdn.microsoft.com/en-us/library/dd456791.aspx example to test feature. That example works using .NET framework, but fails with mono framework. The problem is in line where is UdpDiscoveryEndpoint added. I'am getting exception:

   Contract 'TargetService' is not implemented in this service 'testService'

Steps to reproduce the problem:
I'am adding attachment with test code.

Actual Results:

Expected Results:
Enables WCF discovery on Linux machine(mono) and could be discovered using DiscoveryClient class in windows machine(.NET).

How often does this happen? 

Additional Information:
Using latest mono framework package(mono 3.0.7-1) from Arch linux repositories.
Comment 1 Seifer 2013-12-13 05:02:21 UTC
I experience the same issue.

Mono version: 3.2.5
Operation System: Mac OS X 10.9


Unhandled Exception:
System.InvalidOperationException: Contract 'TargetService' is not implemented in this service 'Foo'
  at System.ServiceModel.ServiceHostBase.AddServiceEndpoint (System.ServiceModel.Description.ServiceEndpoint endpoint) [0x00000] in <filename unknown>:0 
  at Test.Main () [0x00000] in <filename unknown>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.InvalidOperationException: Contract 'TargetService' is not implemented in this service 'Foo'
  at System.ServiceModel.ServiceHostBase.AddServiceEndpoint (System.ServiceModel.Description.ServiceEndpoint endpoint) [0x00000] in <filename unknown>:0 
  at Test.Main () [0x00000] in <filename unknown>:0 

Test code:

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ServiceModel;
using System.ServiceModel.Channels;
using System.ServiceModel.Description;
using System.ServiceModel.Dispatcher;
using System.ServiceModel.Discovery;

public class Test
	public static void Main ()
		ServiceHost host = new ServiceHost (typeof(Foo));

		host.Description.Behaviors.Add(new ServiceMetadataBehavior());
			new BasicHttpBinding(), 

		// Add a ServiceDiscoveryBehavior
		host.Description.Behaviors.Add(new ServiceDiscoveryBehavior());

		// Add a UdpDiscoveryEndpoint
		host.AddServiceEndpoint(new UdpDiscoveryEndpoint());

		host.Open ();
		Console.WriteLine ("Hit [CR] key to close ...");
		Console.ReadLine ();
		host.Close ();

	public interface IFoo
		void Message(string msg);

	public class Foo: IFoo
		public void Message(string msg)
			Console.WriteLine (msg);
Comment 2 redmanmale 2016-03-09 15:47:36 UTC
Same for me.
Three years passed, this bug's still here.