【发布时间】:2009-04-22 20:13:04
【问题描述】:
我在共享托管环境中部署了 WCF 服务。因此,我必须指定baseAddressPrefixFilters(请参阅答案here 了解为什么这是必要的)。设置基地址前缀过滤器发生在 web.config 中,如下所示...
<serviceHostingEnvironment>
<baseAddressPrefixFilters>
<add prefix="http://example.com"/>
</baseAddressPrefixFilters>
</serviceHostingEnvironment>
问题是我有多个环境以这种方式配置有自己的 url(即 dev、test、prod)
我尝试了以下没有运气...
<serviceHostingEnvironment>
<baseAddressPrefixFilters>
<add prefix="http://dev.example.com"/>
<add prefix="http://test.example.com"/>
<add prefix="http://example.com"/>
</baseAddressPrefixFilters>
</serviceHostingEnvironment>
那么问题是如何在运行时动态设置baseAddressPrefixFilter?
【问题讨论】:
标签: c# asp.net wcf wcf-binding