简体   繁体   English

找不到端点元素

[英]Could not find endpoint element

    <services>
  <service name="Lobby server.User Service" behavior Configuration="Service Behavior User">
    <host>
      <base Addresses>
        <add baseAddress="net.tcp://localhost:5061" />
      </base Addresses>
    </host>
    <!-- Service Endpoints -->
    <endpoint address="user" binding="netTcpBinding" binding Configuration="User Binding" contract="Lobby server.IUserService" />
    <endpoint address="user/Mex" binding="mexTcpBinding" name="ServiceBehaviorUser" contract="IMetadataExchange" />
  </service>

  <service name="Lobby server.Public Service" behavior Configuration="ServiceBehaviorPublic">
    <host>
      <base Addresses>
        <add baseAddress="net.tcp://localhost:5049" />
      </base Addresses>
    </host>
    <!-- Service Endpoints -->
    <endpoint address="public" binding="netTcpBinding" binding Configuration="Public Binding" contract="Lobby server.IPublicService" />
    <endpoint address="public/Mex" binding="mexTcpBinding" name="ServiceBehaviorPublic" contract="IMetadataExchange" />
  </service>

</services>
<behaviors>
  <service Behaviors>
    <behavior name="ServiceBehaviorUser">
      <service Debug includeExceptionDetailInFaults="true" />
      <service Metadata />
      <service Credentials useIdentityConfiguration="true">
        <service Certificate find Value="pident.cloudapp.net" store Location="CurrentUser" storeName="My" x509FindType="FindBySubjectName" />
      </service Credentials>
      <service Authorization principalPermissionMode="Always" />
    </behavior>

    <behavior name="ServiceBehaviorPublic">
      <service Debug includeExceptionDetailInFaults="true" />
      <service Metadata />
      <service Credentials>
        <service Certificate find Value="pident.cloudapp.net" store Location="CurrentUser" storeName="My" x509FindType="FindBySubjectName" />
      </service Credentials>
    </behavior>

  </service Behaviors>
</behaviors>

错误

I check the contract and name but then also error occur and address is null. 我检查合同和名称,但然后也发生错误,地址为空。

Error: 错误:

Could not find endpoint element with name NetTcpBinding_IUserService and contract Lobby server.IUserService in the Service Model client configuration section. 找不到名称为NetTcpBinding_IUserService的端点元素,并在服务模型客户端配置部分中找到Lobby server.IUserService。 This might be because no configuration file was found for your application, or because no endpoint element matching this name could be found in the client element. 这可能是因为没有为您的应用程序找到配置文件,或者因为在客户端元素中找不到与此名称匹配的端点元素。

Any idea what is going wrong? 什么出了什么问题? Any help would be appreciated.Thanks 任何帮助将不胜感激。谢谢

There is no endpoint with name: NetTcpBinding_IUserService 没有名称的端点:NetTcpBinding_IUserService

Try giving a name to the endpoint you want to use. 尝试为要使用的端点指定名称。 Creating a channelFactory required the name of your endpoint indtead the name of your service. 创建channelFactory需要您的端点名称而不是您的服务名称。

Replace your nettcp endpoint with this one 用这个替换你的nettcp端点

<endpoint address="user" binding="netTcpBinding" binding Configuration="User Binding" 
 contract="Lobby server.IUserService" name="endpoint_NetTcp_IUserService"/>

And reference in your code like this: 在你的代码中引用如下:

new DuplexChannelFactory<IUserService>(new UserHandler(), "endpoint_NetTcp_IUserService");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM