Method to create a configuration file (web.config)

Asked By 0 points N/A Posted on -

How can I create a configuration file (web.config) on my PC? Thanks in advance for the explanation submitted.

Best Answer by ali
Answered By 0 points N/A #330572

Method to create a configuration file (web.config)


Hi! I very well know web developer and have much knowledge about XML as you can create a configuration file (web.config) by using XML itself. The below thesis shows the process to create it.

Used Notepad to create a web.config file. You must create a text file that is named Web.config in the root directory of your ASP.NET application. The Web.config file must be a well-formed XML document and must have a format similar to the – %SystemRoot%\Microsoft.NET\Framework\%VersionNumber%\CONFIG\Machine.config file.

The Web.config file must contain only entries for configuration items that override the settings in the Machine.config file. At a minimum, the Web.config file must have the <configuration> element and the <system.web> element. These elements will contain individual configuration elements.

The following example shows a minimal Web.config file:

<?xml version=”1.0″ encoding=”utf-8″ ?>






The first line of the Web.config file describes the document as XML-formatted and specifies the character encoding type. This first line must be the same for all .config files.

The lines that follow mark the beginning and the end of the <configuration> element and the <system.web> the element of the Web.config file. By themselves, these lines do nothing. However, the lines provide a structure that permits you to add future configuration settings. You add the majority of the ASP.NET configuration settings between the <system.web> and </system.web> lines. These lines mark the beginning and the end of the ASP.NET configuration settings.

I hope you have understood now how to create one and will use it for your work.

Login/Register to Answer

Related Questions