I have a WCF service which has an endpoint with a net.tcp binding.
var baseAddress = new Uri("net.tcp://localhost:8000/ServiceModelSamples/Service2"); var selfHost = new ServiceHost(typeof(CpuUsageProvider), baseAddress);
selfHost.AddServiceEndpoint(typeof(IGetCpuUsage), new NetTcpBinding(), "CpuUsageProvider"); var smb = new ServiceMetadataBehavior { HttpGetEnabled = false }; selfHost.Description.Behaviors.Add(smb); selfHost.Open();
When I try to add a service reference to this service to a client project using 'Add Service Reference' option in VS by giving the Service Address :
"net.tcp://localhost:8000/ServiceModelSamples/Service2" , it gives an error saying
"There was an error downloading metadata from the address. Please verify that you have entered a valid address".
Am I doing something wrong here. Does it take a net.tcp address at all OR only http address ? If not, what is the correct way to expose a WCF service with a net.tcp binding ?