Analysis of the differences between Web.config and App.config
- 2020-06-07 04:22:16
web. config is the configuration file for web applications that provide the configuration for web applications. In your web program, you can create one web.config for each folder.
app. config is the configuration file for the desktop application. When you create a desktop application project in ES11en.net and add an application configuration file, it is automatically named as < appname > .exe.config, and automatically associated with your program.
Whether web. config or app. config, you can get the value of appsetting by using the following method:
System. Configuration. COnfigurationSettings. AppSettings [" Key "]
If you make changes to ES34en.config, your web application will immediately load the new ES37en.config. When you make changes to app.config, you must restart the desktop application for app.config to take effect.
I found the following things on the 1 data, but I am not sure whether there are other differences between the two:
app. config, as the name implies, is a configuration file for desktop applications, and it cannot be used with the Class class library. web. config is the configuration file for the ES52en. NET application.
ps: Class class library can read configuration files as xml, but ConfigurationSettings.AppSettings ("")
For example, if an ES65en.NET application project with ES63en.config contains an class library with ES68en.config written in C#, when the project is running, the configuration file associated with it should be ES71en.config, not app.config, because it is an ES75en.NET application.