App.Config vs Resources.resx [Answered]
What's the main difference between them also why App.Config considered more secure approach ?
2nd question: Can i store type values with App.Config like ConsoleColor.Red ?
8 Replies
bump
app.config would store settings about your application from an execution standpoint, it's not particularly secure, especially for a client app. You have prebuilt structures for things like connection strings
A resource file is typically used to store information about your application from a usage perspective, label fields, etc. There is a whole system for resource files in different languages for instance.
Also there is AppSettings
I am really confused about those
What would you prefer ?
AppSettings.json?
App.Config is pretty rigid and in code has a lot of static helper classes, I don't personally like it, people tend to use ConfigurationManager class like it's going out of style and I think it promotes bad coding practices.
There is type safety issue too
for example:
I have no way to track usage of "SomeKey", other than searching code.
I always advise not to use something like ConfigurationManager directly, but to build facades over it
with AppSettings.json this is much easier to do.
ok thanks
✅ This post has been marked as answered!