我是否可以<appSettings />
在我的 app.config 中有一个包含许多设置的部分,但它也引用<appSettings />
了不同文件中的一个部分?
这将允许我保留只有开发人员应该感兴趣的配置选项,例如在主窗口上显示调试输出的选项(非常混乱但对我有用)或将某些文件保存到特定位置。
具体来说,这就是我想要实现的目标:
<!-- this is the appSettings section of the normal app.config file,
which also contains everything else that app.config would -->
<appSettings configSource="AppSettings.config"> <!-- references another file -->
<add key="deployment_config_option1" value="1"/>
<add key="deployment_config_option2" value="2"/>
</appSettings>
<!-- this a new appSettings section of another file called DevSettings.Config
which only contains settings us developers are interested in
by keeping these settings in a different file,
I can ensure it's never deployed -->
<appSettings> <!-- references another file -->
<add key="show_debug_on_screen" value="true"/>
<add key="save_copy_to_desktop" value="false"/>
</appSettings>