If you need them to be configured by the user of your software, I would not do option 3. If they are settings that you define as a programmer, and do not expect them to change when your application is in production, you can do what.
I would say that option 4 and 2 are basically the same, conceptually, and this is a personal preference to choose. Personally, I like to define a user configuration section , and then it only has this section, its own .config file defined in it ( this shows how to do this) so that you do not have a really massive web.config that the user must execute.
I would choose option 1 if I had a script in which I had several components that needed access to the same configuration. If everything you build is a single web application, it does not seem necessary to me to do this, but if you have a web application and some other client application, and both require access to the database, then saving the configuration there is a good choice .
source share