Multiple AppSettings files, is it possible?

You can’t have more than one appsettings because that’s the name of a section. You can add a new section though that uses the same kind of section definition as appsettings. E.g.,

<configuration>
    <configSections>
        <section name="DatabaseConfig" type="System.Configuration.NameValueFileSectionHandler, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
    </configSections>
    ....
    <DatabaseConfig>
       <add key="Whatever" value="stuff"/>
    </DatabaseConfig>
</configuration>

Leave a Comment