我现在的情况是只想更新WCF终结点URL的一部分。目前我们通过包含每个“变量”所有终结点的不同配置来实现这一点。这样管理起来很麻烦。我想设置一个在web.config中进行转换的方法。
以下是两个文件的示例
开发环境
<endpoint address="http://servicesdev.host.com/RPUtilityServices/LogException.svc/restService"
behaviorConfiguration="restfulBehavior"
binding="webHttpBinding"
contract="Host.RP.Shared.Common.Services.Utility.Interfaces.IExceptionUtilityService"
name="LogService" />
以及更多这样的内容
分期
<endpoint address="http://servicessta.host.com/RPUtilityServices/LogException.svc/restService"
behaviorConfiguration="restfulBehavior"
binding="webHttpBinding"
contract="Host.RP.Shared.Common.Services.Utility.Interfaces.IExceptionUtilityService"
name="LogService" />
区别在于servicessta和servicesdev。现在我还有servicesuat和servicesqa等等。我想设置一个转换,只替换dev为sta等等,而不是整个块(使用xdt:Transform="Replace"
)。
但我该怎么做呢?