43
Does anyone know if there is a way to "transform" specific sections of values instead of replacing the whole value or an attribute?
For example, I've got several appSettings entries that specify the URLs for different webservices. These entries are slightly different in the dev environment than the production environment. Some are less trivial than others
<!-- DEV ENTRY -->
<appSettings>
<add key="serviceName1_WebsService_Url" value="http://wsServiceName1.dev.example.com/v1.2.3.4/entryPoint.asmx" />
<add key="serviceName2_WebsService_Url" value="http://ma1-lab.lab1.example.com/v1.2.3.4/entryPoint.asmx" />
</appSettings>
<!-- PROD ENTRY -->
<appSettings>
<add key="serviceName1_WebsService_Url" value="http://wsServiceName1.prod.example.com/v1.2.3.4/entryPoint.asmx" />
<add key="serviceName2_WebsService_Url" value="http://ws.ServiceName2.example.com/v1.2.3.4/entryPoint.asmx" />
</appSettings>
Notice that on the fist entry, the only difference is ".dev" from ".prod". On the second entry, the subdomain is different: "ma1-lab.lab1" from "ws.ServiceName2"
So far, I know I can do something like this in the Web.Release.Config:
<add xdt:Locator="Match(key)" xdt:Transform="SetAttributes(value)" key="serviceName1_WebsService_Url" value="http://wsServiceName1.prod.example.com/v1.2.3.4/entryPoint.asmx" />
<add xdt:Locator="Match(key)" xdt:Transform="SetAttributes(value)" key="serviceName2_WebsService_Url" value="http://ws.ServiceName2.example.com/v1.2.3.4/entryPoint.asmx" />
However, every time the Version for that webservice is updated, I would have to up