0

We have specific need for Custom configuration in app.config which I have successfully implemented but in case if that section is exponentially increasing which may occur as more and more functionality adding to our application, I want to separate the ConfigSection into separate file and provide the feasibility to load configuration either from Custom ConfigSection or external config file. I want to provide both options so later application admin can choose which way they want upon need. I looked all around internet but nothing found of my interest. First I would like to know if at all is it possible and if so some short example will help me lot.

VyshuRam
  • 93
  • 1
  • 10

1 Answers1

1

You can create your own ConfigSections and put it right in app.config.

Or, if you want, you can put your custom confic section into a separated file and put the path to this file in your app.config file (see below).

<appSettings configSource="appSettings.config" />
<connectionStrings configSource="connectionStrings.config"/>
<pages configSource="pages.config"/>

For more info see this page which will help you decide if a configuration section can be stored externally:

General Attributes Inherited by Section Elements

MaKCbIMKo
  • 2,800
  • 1
  • 19
  • 27