Web. config is a configuration file for web applications. In the web program you developed, you can create a web. config.
App. config is the configuration file of the desktop application. When you create a desktop application project in vs.net and add an application configuration file, it is automatically named <appname>. exe. config and automatically associated with your program.
Whether it is web. config or app. config, you can use the following method to obtain the value of the deleetting section:
System. Configuration. COnfigurationSettings. deleettings ["Key"]
If you modify web. config, your web application will immediately load the new web. config. When you modify the app. config, you must restart the desktop application to make the app. config take effect.
I found the following in some documents, but I am not sure if there is any other difference between them:
App. config, as its name implies, is the configuration file of a desktop application. It cannot be used in Class libraries. Web. config is the configuration file of ASP. NET applications.
(Ps: the Class library can actually read the configuration file by reading xml, but it seems that the ConfigurationSettings. deleettings ("") cannot be used (""))
For example. ASP. the. NET application project contains an app written in C. config class library, when this project is running, the configuration file associated with it should be web. config, not app. config, because it is an ASP.. NET application.