Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

appSettings file attribute equivalent for applicationSettings

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

like image 411
kenwarner Avatar asked Feb 19 '10 22:02

kenwarner


1 Answers

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.

like image 127
dugas Avatar answered Sep 21 '22 10:09

dugas