Mono can host WCF services and expose the WSDL. To get around the XmlSchema error: Named item http://your/contract/here was already contained in the schema object table you need to set MONO_STRICT_MS_COMPLIANT to ‘yes’. Here is how I managed to do that.
// set MONO_STRICT_MS_COMPLIANT
if (Environment.GetEnvironmentVariable("MONO_STRICT_MS_COMPLIANT") != "yes")
{
Environment.SetEnvironmentVariable("MONO_STRICT_MS_COMPLIANT", "yes");
}
var host = new ServiceHost(typeof(Service), new Uri("http://localhost:999/Service.svc"));
host.AddServiceEndpoint(typeof(IService), new BasicHttpBinding(), string.Empty);
// add the MetadataBehavior to enable HttpGet
host.Description.Behaviors.Remove<ServiceMetadataBehavior>();
host.Description.Behaviors.Add(new ServiceMetadataBehavior { HttpGetEnabled = true });
host.Open();
Original post in Chinese is here http://www.cnblogs.com/wdysunflower/archive/2011/07/22/2113112.html