I used these two configuration files many times before, but I did not find the time to fully understand how they really work. Like most people, I understand the basics of how to call WebConfigurationManager.AppSettings["key"] to get the configuration values.
Here are some questions I came up with:
- What happens when you refer to a configuration value in a class library and the library is part of a larger solution? Does app.config need to be copied to the output directory to find the variables? (I think yes)
- Can you directly use the configuration value from app.config in another class library?
- Assuming question 3 is yes, what happens if there are several app.config files from different libraries containing configuration values โโwith the same key?
- What happens when you reference web.config, but in a class library?
- What happens if you link to app.config but to a website or web application project?
c # application-settings configurationmanager
John bubriski
source share