I use the following piece of code to host and start a wcf service using net tcp binding:
public void StartServices()
{
NetTcpBinding portsharingBinding = new NetTcpBinding();
portsharingBinding.PortSharingEnabled = true;
serviceHost = new ServiceHost(intranetDesktopService,new Uri(baseAddress));
serviceHost.AddServiceEndpoint(typeof(IIntranetDesktopServiceListener),
portsharingBinding, endpointAddress);
serviceHost.Open();
}
However, when I open the service i get the following error: {"The TransportManager failed to listen on the supplied URI using the NetTcpPortSharing service: the service failed to listen."} its a AddressAlreadyInUseException
However the address is not already in use... if I change PortSharingEnabled = true to false.. the service runs fine (but I can only have one instance).
I have enabled the Net.TCP Port sharing service and also addedd the SID of the everyone group to the SMSVChost.config file...
Any ideas?