This is my first time working with config files, so I am not sure which direction to go. I have looked around but have not found any specific answers.
I have a some configuration settings, namely a list of integers, a list of custom objects and a single integer. At the moment, I am pursuing XML for my config file, I am using serialisation to store and read my list of custom objects. However, I am not sure of the convention or the possiblitly of storing the other settings in the same file. Ideally I would like it to be a single file configurable via a GUI, can I acheive this with XML?
How can I store and read my other list, and single int independently? i.e. refer to that part of the file? – does serialisation allow for this or do I need multiple files? Would that be bad practice?
Should I use a differnt type of config file, or use settings in addition to my XML file? Is it bad practice to have more than one mode of configuration?
Many thanks for any advice you can provide!
I used to store configuration information in app.config file (not separate). However working for big companies I found that on production you don’t have access to app.config file (only IT personal can have access to production). So if you need to change configuration you need to go through change request, and it takes time. So in this case I started to store my configuration information in database. This way I can change at any time and I don’t need go through change request.
About separate xml or app.config. I would use separate config file in case if you have a lot of config information, or information that is structured/nested, but most of the time (99%) I would use just app.config for this.
Check this out how to store int array in application settings