yazan3000
asked on
web.config
Hi experts ..
what is the use of the file : web.config in my asp.net application ?
what is the use of the file : web.config in my asp.net application ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
In addition to what ToAoM has already mentioned I want to provide this additional information.
This is the order in which the ASP.Net worker process reads configuration files is - Machine, Site, Application, SubFolder.
'machine.config' is the only mandatory ASP.Net configuration file - all the rest are optional though you'll need the other web.config files for most of your applications.
Here are the details:
1. Machine
File Name: machine.config
Location: Typically it is found in your operating system's sub directory for Microsoft.Net. My Win2000 machine has this file at this location:
C:\WINNT\Microsoft.NET\Fra
Generally you'll put settings that are applicable to all ASP.Net web applications running on your machine here.
Helpful Tip:This file has excellent documentation and samples for the configuration settings that you can do.
2. Site
File Name: web.config
Location: Typically the root web publishing folder. My machine has it at this location:
C:\Inetpub\wwwroot\
3. Application
File Name: web.config
Location: C:\Inetpub\wwwroot\MyWebAp
If you use VS.Net, it creates and puts this file in your web application folder.
4. SubFolder
File Name: web.config
Location: C:\Inetpub\wwwroot\MyWebAp
You can add this configuration to any subfolders in your web application to override the settings for the web pages and controls inside the folder.
ASP.Net worker process reads values from top to bottom and the settings in a lower configuration file override the ones at an upper level. However, not all configuration settings can be put at all levels. Some configruation settings like 'ProcessModel' settings have to be only at machine.config. You cannot put Authentication settings at Subfolder level (if you do, it will be ignored). It should be at Application Level web.config.
While working with config files, it is very important to understand this hierarchy.