I have a WCF service that I am deploying in a shared hosting environment. Because of this I have to specify baseAddressPrefixFilters (see answer here for why this is necessary). Setting the base address prefix filters happens in the web.config like so...
<serviceHostingEnvironment>
<baseAddressPrefixFilters>
<add prefix="http://example.com"/>
</baseAddressPrefixFilters>
</serviceHostingEnvironment>
The problem is that I have multiple environments that are configured this way with their own urls (i.e. dev, test, prod)
I tried the following with no luck...
<serviceHostingEnvironment>
<baseAddressPrefixFilters>
<add prefix="http://dev.example.com"/>
<add prefix="http://test.example.com"/>
<add prefix="http://example.com"/>
</baseAddressPrefixFilters>
</serviceHostingEnvironment>
So the question is how do I set the baseAddressPrefixFilter dynamically at runtime?