I’m always battling the decision whether to store a constant (key) value in a C# class or .config file.
Is there a good hard rule that says don’t store constants in the web.config? In other words, what are the disadvantages to storing what type of values in a .config vs. a constant in a class?
Constants, by definition, do not change. These are things like pi and who kidnapped the Lindbergh baby. There is no need to store these in a config file, as if they can change then they are not constant.
If the value can change (i.e. is not constant), then store it in a config file or some other user-configurable area.