Correct implementation of a custom config section with nested collections?

I finally found this guy’s example. It was coded and worked right out of the box. http://manyrootsofallevilrants.blogspot.com/2011/07/nested-custom-configuration-collections.html I am going to paste the code here……only because I cannot stand it when someone says “Your answer is here”, and the link is dead. Please try his website first, and leave a “thank you” if it works. … Read more

SSIS how to set connection string dynamically from a config file

First add a variable to your SSIS package (Package Scope) – I used FileName, OleRootFilePath, OleProperties, OleProvider. The type for each variable is “string”. Then I create a Configuration file (Select each variable – value) – populate the values in the configuration file – Eg: for OleProperties – Microsoft.ACE.OLEDB.12.0; for OleProperties – Excel 8.0;HDR=, OleRootFilePath … Read more

Modify config file using bash script

A wild stab in the dark for modifying a single value: sed -c -i “s/\($TARGET_KEY *= *\).*/\1$REPLACEMENT_VALUE/” $CONFIG_FILE assuming that the target key and replacement value don’t contain any special regex characters, and that your key-value separator is “=”. Note, the -c option is system dependent and you may need to omit it for sed … Read more

Which design patterns can be applied to the configuration settings problem?

I prefer to create an interface for setting query, loading, and saving. By using dependency injection, I can inject this into each component that requires it. This allows flexibility in terms of replacing the configuration strategy, and gives a common base for everything to work from. I prefer this to a single, global “settings loader” … Read more

Programmatically encrypting a config-file in .NET

To summarize the answers and what I’ve found so far, here are some good links to answer this question: Encrypting Configuration Information in ASP.NET 2.0 Applications – 4GuysFromRolla.com How To: Encrypt Configuration Sections in ASP.NET 2.0 Using DPAPI – MSDN Please feel free to complement with other links, maybe some to WinForms- or WPF-applications.