我不断收到无法解释的异常
Service 'EmployeeManagerImplementation.EmployeeManagerService' has zero application (non-infrastructure)
endpoints. This might be because no configuration file was found for your application,
or because no service element matching the service name could be found in the configuration file, or because no endpoints were defined in the service element.
我发现其他帖子已经解决了这个问题,但似乎没有人有一个准确的答案
答案,他们的解决方案都不适合我。
服务具有零个应用程序(非基础设施)端点 https://stackoverflow.com/questions/2328840/service-has-zero-application-non-infrastructure-endpoints
这是我的 app.config
<system.serviceModel>
<services>
<service name="Some.Test.EmployeeManagerService">
<endpoint address="net.tcp://localhost:8080/Service" binding="netTcpBinding"
bindingConfiguration="" contract="Contracts.IEmployeeManagerService" />
<endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange"/>
</service>
</services>
</system.serviceModel>
我的合同:
[ServiceContract(Namespace="Some.Test")]
public interface IEmployeeManagerService
{
[OperationContract]
string Test();
}
我的服务:
public class EmployeeManagerService : IEmployeeManagerService
{
public string Test()
{
return "test";
}
}
在相关帖子中,人们建议给合同一个命名空间,并在我的 app.config 中使用它作为服务选项卡中名称的前缀。
还有人建议公开墨西哥终点......
我真的不明白这与它有什么关系,但我以任何方式做到了。
那么对于为什么会发生这种情况有什么想法吗?
以及如何真正解决这个问题?