Service has zero application (non-infrastructure) endpoints

后端 未结 16 1741
抹茶落季
抹茶落季 2020-12-02 18:05

I recently created a WCF service (dll) and a service host (exe). I know my WCF service is working correctly since I am able to successfully add the service to WcfTestClient.

16条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-02 18:22

    I got a more detailed exception when I added it programmatically - AddServiceEndpoint:

    string baseAddress = "http://" + Environment.MachineName + ":8000/Service";
    ServiceHost host = new ServiceHost(typeof(Service), new Uri(baseAddress));  
    
    host.AddServiceEndpoint(typeof(MyNamespace.IService),
                            new BasicHttpBinding(), baseAddress);
    host.Open();
    

提交回复
热议问题