Click here to Skip to main content
Click here to Skip to main content
Alternative Tip

Tagged as

Supporting Development and Release web.config in ASP.NET

, 10 Jan 2011
Rate this:
Please Sign up or sign in to vote.
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)

Share

About the Author

Spectre_001
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... PinmemberSpectre_00111-Jan-11 1:52 
GeneralThis is new to me. But why do you have to maintain all the o... PinmemberVenkatesh Mookkan10-Jan-11 17:10 
GeneralRe: At another place I worked, this is the way we did it as well... PinmemberKevinAG31-Jan-11 11:40 

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

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

| Advertise | Privacy | Mobile
Web03 | 2.8.140814.1 | Last Updated 10 Jan 2011
Article Copyright 2011 by Spectre_001
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid