我使用web.config转换,如下面的帖子所述,以便为不同的环境生成配置.
http://vishaljoshi.blogspot.com/2009/03/web-deployment-webconfig-transformation_23.html
我可以通过匹配键来进行"替换"转换,例如.
<add key="Environment" value="Live" xdt:Transform="Replace" xdt:Locator="Match(key)" />
我还可以做"插入".
<add key="UseLivePaymentService" value="true" xdt:Transform="Insert" />
但是我really发现有用的是ReplaceOrInsert转换,因为我不能总是依赖原始配置文件有/没有某个键.
有什么办法可以做到这一点吗?