Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# Settings Management

Tags:

c#

xml

settings

I feel like I am always reinventing the wheel for each application when it needs to load/save general settings to an xml file. What is the best way to manage basic application settings that the user can adjust and need to be saved/restored?

like image 686
Superman Avatar asked Jan 17 '09 20:01

Superman


2 Answers

I like the use of custom configuration sections in .config files coupled with loading external .config files instead of the standard app.config.

like image 73
Tom Anderson Avatar answered Sep 22 '22 21:09

Tom Anderson


Are you using Visual Studio? There's a built-in settings manager and I find it works well for most situations. Just don't forget to call Settings.Save() before the application quits.

like image 26
lc. Avatar answered Sep 25 '22 21:09

lc.