我试图托管服务并通过本地网络访问它。主机服务用于通过局域网访问的Visual Studio开发服务器
这是我的app.config的一部分:
<client>
<endpoint address="net.tcp://<my IP>:49770/Service1.svc"
binding="netTcpBinding" contract="ServiceReference1.IService1"
name="LAN" />
<endpoint address="http://localhost:49770/Service1.svc" binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_IService1" contract="ServiceReference1.IService1"
name="BasicHttpBinding_IService1" />
</client>
本地主机端点的伟大工程,如果我一台机器上工作,但LAN终端将无法正常工作。 这是我用来通过LAN端点连接的代码。
ServiceReference1.Service1Client client = new
ServiceReference1.Service1Client("LAN");
我阅读这篇文章,但它仍然是行不通的:
how to connect to WCF web service inside lan
您是否添加了防火墙规则以允许在Windows防火墙中传入端口49770 TCP? – PhonicUK 2012-08-17 15:08:40
谢谢你的快速回答。我现在做了,但仍然无法连接。 – Manuel 2012-08-17 15:43:28
也许这是错误的,asp.net开发人员的服务器启动localhost? – Manuel 2012-08-17 16:22:09