public static ServiceHost CreateNamedPipeHost(Type serviceType, Type interfaceType) { ServiceHost pipeHost = new ServiceHost(serviceType); AddNamedPipeEndPoint(pipeHost, interfaceType); return pipeHost; }