Splitting Web.config into multiple files

Reading large XML isn't fun and that's kind of what started happening to my web.config file: tracing, entity framework, database connection strings, service endpoints definition etc, etc, etc...

Thankfully there is a way of splitting the web.config into multiple files so that it is easier to read and modify.

  1. Create new config file: preferably with a meaningful name e.g. for system.diagnostics -> Diagnostics.config
  2. Paste your section of the code there including the tag
  3. Reference it in the Web.config

For example:
Diganostics.config:

Web.config



VoilĂ !

Leave Comment

Your email address will not be published.

Please type the characters of this captcha image in the input box

Please type the characters of this captcha image in the input box