Service has zero application (non-infrastructure) endpoints

后端 未结 16 1712
抹茶落季
抹茶落季 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:41

    This error will occur if the configuration file of the hosting application of your WCF service does not have the proper configuration.

    Remember this comment from configuration:

    When deploying the service library project, the content of the config file must be added to the host's app.config file. System.Configuration does not support config files for libraries.

    If you have a WCF Service hosted in IIS, during runtime via VS.NET it will read the app.config of the service library project, but read the host's web.config once deployed. If web.config does not have the identical configuration you will receive this error. Make sure to copy over the configuration from app.config once it has been perfected.

提交回复
热议问题