多くの設定が含まれていますが、別のファイルの<appSettings />
セクションも参照している私のapp.configに<appSettings />
セクションがあるのは可能ですか?<appSettings />は設定を含み、別の<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>
は、最も可能性の高いhttp://stackoverflow.com/questionsに重複しています/ 2560020/multiple-app-config-files –
これは重複していません。その質問は私よりも一般的です。 – DaveDev
基本的には同じことです。 app.configに他の設定を含めたいとします。 2番目の設定を展開したくない場合は、配備したapp.configのapp config includeを削除するだけです。 –