Difference between Web. config and App. config

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.