【问题标题】:Can't launch service with net.tcp binding error 10049无法使用 net.tcp 绑定错误 10049 启动服务
【发布时间】:2017-02-17 08:03:48
【问题描述】:

我在使用 net.tcp 端点启动 WCF 服务时遇到问题。我收到 10049 错误。

我的app.config

<system.serviceModel>
    <services>
        <service behaviorConfiguration="ServiceBehaviour0"
                 name="Tinkl.Server.Services.Authentication.AuthenticationService">
            <endpoint name="httpEndpoint"  
                address="reg"
                binding="basicHttpBinding"
                contract="Tinkl.Server.Services.Authentication.IRegistrationService" />
           <endpoint name="httpEndpoint" 
               address="auth"
               binding="basicHttpBinding"
               contract="Tinkl.Server.Services.Authentication.IAuthorizationService" />
           <!--
           <endpoint name="tcpEndpoint" 
               address="net.tcp://78.26.210.203:50050/reg"
               binding="netTcpBinding"
               contract="Tinkl.Server.Services.Authentication.IRegistrationService" />
           <endpoint name="tcpEndpoint"
               address="net.tcp://78.26.210.203:50051/auth"
               binding="netTcpBinding"
               contract="Tinkl.Server.Services.Authentication.IAuthorizationService" />
               -->
           <endpoint name="mexEndpoint"
               address="mex"
               binding="mexHttpBinding" bindingConfiguration=""
               contract="IMetadataExchange" />
           <host>
               <baseAddresses>
                   <add baseAddress="http://78.26.210.203:50076/" />
               </baseAddresses>
           </host>
        </service>
    </services>
    <behaviors>
        <serviceBehaviors>
            <behavior name="ServiceBehaviour0">
                <!--<serviceMetadata />-->
                <serviceMetadata httpGetEnabled="true" />
                <serviceDebug includeExceptionDetailInFaults="True" />
            </behavior>
        </serviceBehaviors>
    </behaviors>

netTcpBinding 有 2 个端点,basicHttpBinding 有 2 个完全相同。

当我尝试使用netTcpBinding 端点时出现问题,我收到错误消息,但使用basicHttpBinding 可以正常工作...

我在控制台应用程序中托管 WCF 服务。

程序代码

ServiceHost authenticationHost = new ServiceHost(typeof(AuthenticationService));
authenticationHost.Open();

Console.WriteLine("close <ENTER>\n");

Console.ReadLine();
authenticationHost.Close();

也许有人遇到过类似的问题?

如果需要,我会提供所有必要的附加信息

提前谢谢你!

【问题讨论】:

标签: c# .net wcf tcp


【解决方案1】:

尝试替换行

net.tcp://78.26.210.203:50050/reg

net.tcp://localhost:50050/reg

/auth 端点也是如此。

【讨论】:

    猜你喜欢
    • 2014-04-29
    • 1970-01-01
    • 2011-10-15
    • 2012-08-30
    • 1970-01-01
    • 2011-05-23
    • 2014-07-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多