Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Supporting Development and Release web.config in ASP.NET

0.00/5 (No votes)
10 Jan 2011 1  
I wrote a custom ConfigSectionHandler that allows encrypted entries. Then I crafted a config reader that determines, based on the name of the machine where the code is running, which configuration section to read from while decrypting any encrypted entries on the fly.There is a special...
I wrote a custom ConfigSectionHandler that allows encrypted entries. Then I crafted a config reader that determines, based on the name of the machine where the code is running, which configuration section to read from while decrypting any encrypted entries on the fly.

There is a special config section defining which section to read values from for each machine (including a default entry that is read from if the current machine is not in the list).

This allows me to maintain a single config file with separate configurations for each environment in separate config sections. The application then reads its configuration values from the appropriate section without any intervention from the person deploying.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here