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

问题描述:

我有一个使用 netTcpBinding 和客户端的 WCF 服务器.当我在本地运行它们时,它们工作正常.

I have a WCF server using a netTcpBinding and a client. When I run them locally they work fine.

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

If I put the server on a Windows Server 2008 machine and try to run it, it fails unless I change the address to localhost, but no clients can connect to it.

我可以从服务器运行客户端以连接到运行服务器的 Windows Xp 机器,一切都很好.

I can run the client from the server to connect to a Windows Xp machine running the server and all is well.

这是服务器绑定:

<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>

我在防火墙上创建了规则以允许所有流量到达我在这里使用的端口,但没有运气.我还需要在 Windows Server 2003 上做些什么才能使其正常工作?

I created rules on the firewall to allow all traffic to the port I am using here, but no luck. Is there something else I need to do on Windows Server 2003 to get this to work?

Net tcp 绑定需要网络激活服务,该服务仅适用于 Windows 2008、Vista 和 Windows 7.这可能是您的问题的一部分.

Net tcp binding reqiures Network Activation Services, which is only available on Windows 2008, Vista and Windows 7. This could be part of your problem.

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

The other is the firewall, have you opened port 3315?