【发布时间】:2015-06-05 15:43:39
【问题描述】:
我有 app.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<!--One set of properties-->
<add key="Condition" value="A"/>
<add key="DependingPropertyA" value="B"/>
<add key="DependingPropertyB" value="C"/>
<!--Another set of properties-->
<add key="Condition" value="B"/>
<add key="DependingPropertyA" value="D"/>
<add key="DependingPropertyB" value="E"/>
</appSettings>
</configuration>
所以我想要 if Condition == A 定义一组属性,如果 Condition == B - 不同的一组属性,所以当我在 A 和 B 之间切换时,我不需要更改所有其他属性。 有可能吗?
【问题讨论】:
-
这是用于必须不同的调试和发布版本
-
没有。这不适用于调试/发布配置。
标签: c# .net configuration config app-config