what is the benefits of XML based configuration file ?

Give me the detailed description of XML based configuration file along with what web.config file contains and how it looks.

Last updated:1/20/2020 12:19:40 AM

1 Answers

Nishi Tiwari
Nishi Tiwari

Benefits of XML-based Configuration files

  •  ASP.NET Configuration systems are extensible and application specific information can be stored and retrieved easily. It is a human readable file.
  •  We need not restart the web server when the settings are changed in configuration file. In ASP.NET automatically detects the changes and automatically applies them to the running ASP.NET application.
  • We can use any standard text editor or XML parser to create and edit ASP.NET configuration files. 

What Web.config file contains?

There are many number of important settings that can be stored in the configuration file. Some of the most frequently used configurations files which are stored conveniently inside Web.config file are: 

  •   Database connections 
  • Caching settings
  •  Session States
  •  Error Handling
  • Security 

Configuration file looks like this

1.	<configuration>  

2. <connectionStrings>
3. <add name='myCon' connectionString='server=MyServer;database=puran;uid=puranmehra;pwd=mydata1223' />
4. </connectionStrings>
5. </configuration/>