Tag: xdt transform

有没有办法使用web.config转换做“replace或插入”?

我正在使用web.config转换,如下面的post所述,以便为不同的环境生成configuration。 http://vishaljoshi.blogspot.com/2009/03/web-deployment-webconfig-transformation_23.html 我可以通过匹配键来进行“replace”转换,例如 <add key="Environment" value="Live" xdt:Transform="Replace" xdt:Locator="Match(key)" /> 我可以做“插入”,例如 <add key="UseLivePaymentService" value="true" xdt:Transform="Insert" /> 但是我真正觉得有用的是一个ReplaceOrInsert转换,因为我不能总是依赖于原来的configuration文件有/没有一定的关键。 有没有办法做到这一点?