Bug 18808 - WCF net tcp export metadata
Summary: WCF net tcp export metadata
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: WCF assemblies (show other bugs)
Version: 3.0.x
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2014-04-03 23:15 UTC by Hugo Arevalo
Modified: 2017-09-06 16:55 UTC (History)
2 users (show)

See Also:
Is this bug a regression?: ---
Last known good build:

Source file to test the bug. (1.33 KB, text/x-csharp)
2014-04-03 23:15 UTC, Hugo Arevalo

Description Hugo Arevalo 2014-04-03 23:15:42 UTC
Created attachment 6491 [details]
Source file to test the bug.

Hi, I'm trying to export the metadata of a WCF nettcp service, the service works fine if I don't want to export metadata but It's a pain on the neck having to copy the assembly to the client application whenever I make a change on the server. I replicated a small example to show the exception I'm receiving. The application works just fine on Visual Studio.

In order to compile the service I run: gmcs -r:System.ServiceModel Main.cs
To run the service I just type: mono Main.exe
Comment 1 Hugo Arevalo 2014-04-04 11:03:07 UTC
Sorry, I forgot to comment that the address is set as localhost, I'll post the code also here.

using System;
using System.ServiceModel;
using System.ServiceModel.Description;

namespace wcfservice
	public class Program
		public static void Main(string[] args)
			var uri = new Uri("net.tcp://localhost:9001/HelloService");
			var host = new ServiceHost(new HelloWorld(), uri);
			host.AddServiceEndpoint(typeof(IHelloWorld), new NetTcpBinding(SecurityMode.None), uri);
			ServiceMetadataBehavior smb = host.Description.Behaviors.Find<ServiceMetadataBehavior>();

			if (smb == null)
				smb = new ServiceMetadataBehavior();



			var behavior = host.Description.Behaviors.Find<ServiceBehaviorAttribute>();
			behavior.InstanceContextMode = InstanceContextMode.Single;

			Console.WriteLine("Hosted {0}", DateTime.Now.ToString());

	public interface IHelloWorld
		string Hello(string Name);
	[ServiceBehavior(InstanceContextMode=InstanceContextMode.Single, IncludeExceptionDetailInFaults=true,ConcurrencyMode=ConcurrencyMode.Reentrant)]
	public class HelloWorld : IHelloWorld
		public string Hello(string Name)
			return string.Format("Hello {0}", Name);

Note You need to log in before you can comment on or make changes to this bug.