1
votes

In ABC.exe.config (app.config)

<configuration>
    <appSettings file="MySettings.config">
        <add key="setting1" value="1" />
    </appSettings>
<configuration>

Here I use "file" attribute, not "configSource", because I want to define default values. How to save to external config file "MySettings.config"? I must keep "ABC.exe.config" unchanged because it will be overwritten on program upgrade without notice. All global settings must be preserved in "MySettings.config"

1
No! This is not the duplicate. I do not use the upgrade method, which stores settings in User account (local). I need to save global settings which stores in the exe folder. - linquize

1 Answers

4
votes

There is an example in the MSDN documentation , the approach is to handle the write to the file yourself, i.e. treat it as a "regular" XML file for example.