views:

263

answers:

1

In a asp.net web.config file you can do

<appSettings file="local.appSettings.config">
    <add key="foo" value="bar" />
</appSettings>

and it will look in local.appSettings.config for any overrides to the foo/bar setting.

Is there an equivalent for applicationSettings? Something like this

<applicationSettings file="local.applicationSettings.config">
    <FooBar.My.MySettings>
        <setting name="foo" serializeAs="String">
            <value>bar</value>
        </setting>
    </FooBar.My.MySettings>
</applicationSettings>

or even a different approach to maintaining a different set of applicationSettings, for instance a set for local development, and a set for production

+2  A: 

I am unaware of an equivalent, but you can utilise the configSource attribute and store the application settings in an external file. Using the configSource attribute, there will not be a merging of settings. Also, I believe the configSource is available starting in .Net 2.0.

thedugas