![](/img/trans.png)
[英]Error with WCF. Could not find a base address that matches scheme http for the endpoint with binding WSHttpBinding
[英]WCF. Multiple HTTP bindings differ only by IP address
我的进程包含端口80上的自托管WCF服务(http绑定)。 我需要能够运行该进程的多个实例。 主机在1个NIC上有多个IP地址。 每个服务实例的服务URI仅因IP地址而异
Process 1: http://192.168.0.1:80/MyService
Process 2: http://192.168.0.2:80/MyService
我认为这应该是可能的,因为URI是唯一的,并且http允许端口与不同的IP地址共享。
当第二个过程开始时,我得到了
HTTP could not register URL http://+:80/MyService/. Another application has already registered this URL with HTTP.SYS
此错误中的“+”表示它正在尝试绑定到所有IP地址的端口80,而不仅仅是指定的地址。
是否可以让WCF将http绑定到一个IP地址?
谢谢
在提出问题后几分钟我找到答案:
只需在App.config文件中的绑定中设置hostNameComparisonMode =“Exact”即可
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.