服务 '' 具有零个应用程序(非基础结构)端点 [英] Service '' has zero application (non-infrastructure) endpoints
问题描述
我不断收到无法解释的异常
i keep getting an unexplained exception
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.
我遇到了其他解决这个问题的帖子,但似乎没有人有一个精确的answer ,他们的解决方案都没有对我有用.
iv'e come across other posts which have solved this problem , but no one seems to have a precise answer , and non of their solutions worked for me .
这里的任何方式都是我的 app.config
any ways here's my 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 中服务选项卡中名称的前缀.
in the related post people advised to give the Contract a namespace , and to use that as a prefix in my app.config for the name in the service tab .
还有人建议公开 mex 端点......我真的不明白这与它有什么关系,但我以任何方式做到了.
also there was a suggestion to expose the mex end point ... i don't really see what this as to do with it but i did it any ways .
那么为什么会发生这种情况的任何想法?以及如何真正解决这个问题?
so any ideas of why this happens ? and how to really resolve this issue ?
推荐答案
来自您自己的评论:
将服务的名称属性设置为与包含命名空间的实现完全相同的名称
Set the name attribute of the service to the exact same name as the implementation including the namespace
这篇关于服务 '' 具有零个应用程序(非基础结构)端点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!