Click here to Skip to main content
15,881,204 members
Articles / Web Development / ASP.NET
Alternative
Tip/Trick

Supporting Development and Release web.config in ASP.NET

Rate me:
Please Sign up or sign in to vote.
4.00/5 (1 vote)
10 Jan 2011CPOL 8.8K   2   3
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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
United States United States
Senior Software Developer US Coast Guard.

Comments and Discussions

 
GeneralThe point is to allow a single .config file to handle all en... Pin
Spectre_00111-Jan-11 1:52
Spectre_00111-Jan-11 1:52 
GeneralThis is new to me. But why do you have to maintain all the o... Pin
Venkatesh Mookkan10-Jan-11 17:10
Venkatesh Mookkan10-Jan-11 17:10 
GeneralRe: At another place I worked, this is the way we did it as well... Pin
KevinAG31-Jan-11 11:40
KevinAG31-Jan-11 11:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.