HTTP无法注册URL ...因为TCP端口...正由另一个应用程序使用

Dmi*_*riy 3 wcf http wcf-binding

首先,我在WCF方面不擅长.我有一个在WindowsService中托管的WCF服务.从某个时候起,服务因异常而停止运行:

HTTP无法注册URL http:// +:8092/MyService /,因为另一个应用程序正在使用TCP端口8092.

  • 没有什么可以使用这个端口,它说我试过的任何端口都是一样的.
  • 已配置SSL证书.

有许多机器可以启动此服务,但最需要(客户)的机器不能.我在这个网站或其他任何地方看过很多帖子,但找不到解决方案.我从来没有看到像"它帮助我"这样的帖子.我已经好几天了,请帮忙.

在配置文件中的数据下面:

<system.serviceModel>
    <services>
      <service name="MyCompany.MyApp.MyAppService" behaviorConfiguration="MetadataSupport">
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:8092/MyAppService" />
            <add baseAddress="net.tcp://localhost:8093/MyAppService" />
            <add baseAddress="net.pipe://localhost/" />
          </baseAddresses>
        </host>
        <endpoint binding="wsDualHttpBinding" contract="MyCompany.MyApp.IMyAppService" />
        <endpoint binding="netTcpBinding" contract="MyCompany.MyApp.IMyAppService" />
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
        <endpoint address="tcpmex" binding="mexTcpBinding" contract="IMetadataExchange" />
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="MetadataSupport">
          <!-- To avoid disclosing metadata information, 
          set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpGetEnabled="True" httpGetUrl="" />
          <!-- To receive exception details in faults for debugging purposes, 
          set the value below to true.  Set to false before deployment 
          to avoid disclosing exception information -->
          <serviceDebug httpHelpPageEnabled="True" includeExceptionDetailInFaults="True" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
Run Code Online (Sandbox Code Playgroud)

Ash*_*mad 7

您正在使用WCF双工通信wsDualHttpBinding.在这种情况下,WCF在端口8092上创建HTTP套接字以服务客户端回调.显然客户端与IIS 5.X冲突.(我猜你有XP和IIS 5.x)

要解决此问题,您必须clientBaseAddress在客户端上提供绑定配置并指定其他端口.

示例客户端配置: 客户端配置代码段

我希望这确实是您机器中的问题,请通知我这个解决方案的结果.

祝好运 :-)