我有一个应用程序绑定在一台机器的IP1:80端口上,该机器有5个虚拟IP地址(IP1-IP5)
然后我尝试将自托管的WCF服务绑定到IP5:80,但出现了AlreadyInUseException异常。我猜测WCF正在尝试绑定整个IP范围,尽管我指定了特定的一个。
这是已知的行为吗?
[start application that binds to IP1:80]
string baseAddress = "http://IP5:80/binary";
ServiceHost host = new ServiceHost(typeof(BinaryService),
new Uri(baseAddress));
host.AddServiceEndpoint(typeof(IBinaryService), GetBinding(), "")
.Behaviors.Add(new WebHttpBehavior());
host.Open(); // exception