The Web config files are the configuration files in your website that manage the various settings in your web application.
These settings are generally stored in form of XML and these settings are separate from your web application code. From this way, you can easily update your web settings on your XML file. Generally, a website contains a single web.config file but if your application requires a different settings for your different directory then you can easily add according to your need in all directories.
Why Configuration File?
Configuration file in the website describe the properties & behaviour of your Web Application. These files manage many settings related to your website. The web configuration are the XML files with the extension of .config. These are the normal text files which can be edited by any of the editors like Notepad, VS code Sublime etc. and they are in the readable forms for the Developer.
Benefits of XML Configuration Files-
1.) Web config Files in ASP.NET are used to store the specific information of websites and retrieve them easily. These are in a human readable form.
2.) If you have made any changes, it does not require restart of the server. These changes will automatically reflect after saving your file on the system.
3.) You can use any text editor or XML parser to create or edit the ASP.NET Configuration files.
Settings in Web.config files-
There are the number of Web.config settings which we define while developing an application:
1.) Database Connection are the most common settings in the Configuration Files.
2.) Error Handling while any HTTP Client Server error occur or while REQUESTED PAGE NOT FOUND error has occur these help the user to handle all the inappropriate request.
3.) Session State in the application for storing the value which were used in entire page of the application.
4.) Caching Settings are the one of the most important setting to speed up your web applications. They are used to store the code snippets. So that the website can load faster.
Types of Configuration files-
Machine.config - Server or machine-wide configuration file
Web.config - Application configuration files which deal with a single application