我不断收到不明原因的异常服务'已经为零应用(非基础设施)端点
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.
iv'e遇到已经解决了这个问题的其他职位,但似乎没有人有一个确切的 答案,而不是他们的解决方案为我工作。
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中的服务选项卡中名称的前缀。
也有人建议揭露mex的终点... 我真的不知道这是怎么回事,但我做了任何方法。
所以,为什么会发生这种情况的任何想法? 以及如何真正解决这个问题?
o'k原来它需要得到服务 完全相同的名称为包括命名空间 实施<服务名称=“EmployeeManagerImplementation.EmployeeManagerService”>的name属性 由于@Johann布莱 HTTP ://堆栈溢出。com/questions/5270956/service-x-has-zero-application-endpoints-unless-i-add-an-endpoint-in-code-wh – 2012-03-21 23:34:21
你应该添加这个答案并接受它。 – flayn 2012-09-07 15:12:49
我把一个链接的答案,帮助我... 一样好:) – 2012-09-08 12:25:44