Search code examples
windowswcfwcf-binding

Making WCF Host with NetNamedPipeBinding reachable from everyone on Windows 10


I have two applications communicating with WCF protocol on NetNamedPipeBinding. One is a service ("S") running under SYSTEM, another one is an application ("A"). The "A" creates a WCF service.

When the "A" is run with the Admin privileges, everything works. But when run under a limited User the "A" can create the WCF service which the "S" cannot reach. The error is:

System.ServiceModel.EndpointNotFoundException: There was no endpoint listening at net.pipe://app/results that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details. ---> System.IO.PipeException: The pipe endpoint 'net.pipe://app/results' could not be found on your local machine. 

The idea is this WCF service to be accessible from every User (Everyone credentials). Can it be done with the NetNamedPipeBinding? Preferably, doing the whole configuration in code, not in a config file.

        var binding = new NetNamedPipeBinding(NetNamedPipeSecurityMode.None);
        var baseAddress = new Uri(url);
        var serviceHost = new ServiceHost(implementor);
        serviceHost.AddServiceEndpoint(typeof(IImplementor), binding, baseAddress);
        serviceHost.Open();

Solution

  • If the code is the same but the access user is different, that means that non-administrator users cannot reach the service.

    Maybe you can try the sample below.It still doesn't work,you can submit the bug file to the official.

    https://learn.microsoft.com/en-us/dotnet/api/system.servicemodel.netnamedpipebinding?view=netframework-4.8

    Thanks.