代码之家  ›  专栏  ›  技术社区  ›  Kelly

WCF TCP绑定“请求的地址在其上下文中无效”错误

  •  0
  • Kelly  · 技术社区  · 15 年前

    我有一个使用nettcpbinding的wcf服务器和一个客户机。当我在本地运行它们时,它们工作得很好。

    如果我将服务器放在WindowsServer2008计算机上并尝试运行它,它将失败,除非我将地址更改为localhost,但没有客户端可以连接到它。

    我可以从服务器运行客户机连接到运行服务器的Windows XP计算机,一切都很好。

    以下是服务器绑定:

    <system.serviceModel>
        <services>
          <service name="Ricochet.Server.Controller">
            <endpoint address="net.tcp://myServerIP:3315" binding="netTcpBinding" contract="Ricochet.Interfaces.IServer" bindingConfiguration="InsecureTcp"/>
          </service>
        </services>
    
        <bindings>
          <netTcpBinding>
            <binding name="InsecureTcp">
              <security mode="None"/>
            </binding>
          </netTcpBinding>
        </bindings>
      </system.serviceModel>
    

    我在防火墙上创建了一些规则,允许所有到我在这里使用的端口的流量,但没有运气。在WindowsServer2003上,我还需要做些什么才能使它正常工作吗?

    1 回复  |  直到 15 年前
        1
  •  0
  •   Shiraz Bhaiji    15 年前

    NET TCP绑定请求网络激活服务,仅在Windows 2008、Vista和Windows 7上可用。这可能是你问题的一部分。

    另一个是防火墙,你打开3315端口了吗?