Saving appSettings when using file=

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
 
M

Miha Markic [MVP C#]

Hi,

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

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top