Saving appSettings when using file=

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an app.config that looks like this:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings
file="External.config" >
</appSettings>
</configuration>

And External.config contains all my settings, e.g.

<?xml version="1.0" encoding="utf-8" ?>
<appSettings>
<add key="setup WebType" value="IIS" />
<add key="setup UseEPG" value="Y" />
</appSettings>

The trouble is, when I update some settings and do a Configuration.Save()
the settings are written back to the app.config and not External.config. Is
this a bug, design feature, or is there a setting to alter this behaviour?
Using .NET 2

Thanks,
John
 
Hi,

The better approach would be to use Application Settings (see .net help
topics).
 
Hi Miha,

Not sure how this would help. I'm using the file= syntax so I can share the
config file between 3 different apps that I'm shipping. I can embed the
settings in specific config files per app but then I need to update all 3.
How does Application Settings help me in this case?

thanks,
John
 
Back
Top