The best for you in this specific situation you can only say.
app.config
is used for general application settings. It should not normally be used to configure specific operation. It is not always easy to determine what is one and what is another. Understand that it was not meant to have frequent changes.
If you have a database I think most settings should be in it.
As far as I understand this information is very specific and only useful if the database is available. I've done a lot of systems like this and never even thought about putting it in the database.
I can not imagine in this case why putting this in the configuration file. It may even be that you need to do something only in the database and without them inside it, it would be tricky to accomplish. This information is domain-specific and not the application as a whole. It is a mistake to app.config
.
Overall
What to put in the configuration outside the database:
- what tells you how to access the database directly or indirectly, which for obvious reasons can not be inside the database (can be network information)
- Information that other applications or the runtime environment need to access at some point
- situations that can give a good reason to go there.
In the database you have this more "protected" information. And it has more features, even for auditing and versioning.
In some cases if you do not want to put it in the database, you need to think about whether it is not the case of using a separate configuration file. I find it rare to need something like this.
Obviously, if you use a library that requires setting up there, you have no choice but to switch library:)
If the application does not have a database, of course this solution is not ideal.
Some people use SQLite as the configuration file. If it's just for that, unless the configuration is too complex, I do not think it's feasible. But if SQLite is already there for some reason, then it might be a good thing to put it in.
If you only have the database on another machine you might want to use the same application offline. There is reason to use a configuration file. Or a local database like SQLite, if you already use it for something.
On the other hand, if you want that user to have their configurations preserved on all machines that go to use, placing the settings in a centralized database is the only option, although there may be a hybrid way to handle disconnected cases.
It's easier to do right in the database.
The basic rule is to use the database, and only opt in another way if you have a good reason to do so. But there should only be settings there that are only needed when the database is available.