我已经阅读了这个元素的文档,但仍然无法理解它的目的是什么。这是我在示例中看到的示例:
<serviceHostingEnvironment>
<baseAddressPrefixFilters>
<add prefix="http://localhost:5100/"/>
</baseAddressPrefixFilters>
</serviceHostingEnvironment>
我想了解服务节点中的基地址没有做什么。我不明白这个元素的实际用途。
我已经阅读了这个元素的文档,但仍然无法理解它的目的是什么。这是我在示例中看到的示例:
<serviceHostingEnvironment>
<baseAddressPrefixFilters>
<add prefix="http://localhost:5100/"/>
</baseAddressPrefixFilters>
</serviceHostingEnvironment>
我想了解服务节点中的基地址没有做什么。我不明白这个元素的实际用途。
WCF 服务主机将只允许每个方案有一个基地址(在本例中为 HTTP)。现在,如果您在配置有多个基地址(例如http://www.example.com和http://example.com )的 IIS 上部署 WCF 服务,您将看到一个错误。使用 baseAddressPrefixFilters 您可以过滤两个基地址之一,您的服务将运行得很好。