Rick Strahl's Weblog  

Wind, waves, code and everything in between...
.NET • C# • Markdown • WPF • All Things Web
Contact   •   Articles   •   Products   •   Support   •   Advertise
Sponsored by:
Markdown Monster - The Markdown Editor for Windows

Updated Configuration Class Article and Code


:P
On this page:

I've updated the Building a better .Net Application Configuration Settings Class article and code. There have been a number of additions to the class including support for writing to external .Config files and writing to custom sections.

I've also fixed a bug that would cause the class to blow up if you didn't have rights in ASP.Net to write the file (oops!). This relates to my recent post Configuration File Settings and ASP.Net Security. Previously the class didn't check for failure in the DOM output routine which would blow up. Now the code traps any write errors but still doesn't write. I've also changed the signature to return a bool to let you know whether the write worked.

Finally I've changed the syntax for handling encryption and sections so that it is more 'natural' rather than writing a convoluted constructor. The old syntax still works, but there are now methods to specify the fields to encrypt and the section to write to. These methods can be called externally or be embedded into a custom constructor which still has to call the : base(false) to prevent the default loading of config settings before these settings are made. The article's text has been updated to reflect this info as well.

 

 


The Voices of Reason


 

Rick Strahl's Web Log
October 29, 2006

# Configuration File Settings and ASP.Net Security - Rick Strahl's Web Log

Somebody brought up a good point about my Configuration Settings class today that I failed to mention in the article: Security requirements for an ASP.Net application to be able to actually make changes to the .Config file.

West Wind  © Rick Strahl, West Wind Technologies, 2005 - 2024