65.9K
CodeProject is changing. Read more.
Home

Supporting Development and Release web.config in ASP.NET

starIconstarIconstarIconstarIconemptyStarIcon

4.00/5 (1 vote)

Jan 10, 2011

CPOL
viewsIcon

9223

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.