HI...
I want to know, what is the main use of web.config and machine.config in asp.net ?
Thanks.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Anuja PawarPosted Jan 10, 2012, 7:30 AM
Web.config file in ASP.NET, as it sounds like is a configuration file for the Asp .net web application. An Asp .net application has one web.config file which keeps the configurations required for the corresponding application. Web.config file is written in XML with specific tags having specific meanings.
Generally we store database connections, Session States, Error Handling, Security configurations in ASP.NET web.Config file.
Multiple configuration files, all named Web.config, can appear in multiple directories on an ASP.NET Web application server. Each Web.config file applies configuration settings to its own directory and all child directories below it. Configuration files in child directories can supply configuration information in addition to that inherited from parent directories, and the child directory configuration settings can override or modify settings defined in parent directories. The root configuration file named systemroot\Microsoft.NET\Framework\versionNumber\CONFIG\Machine.config provides ASP.NET configuration settings for the entire Web server.
Ankit ShivnakrPosted Jan 10, 2012, 7:34 AM
The Machine.Config file, which specifies the settings that are global to a particular machine. This file is located at the following path
\WINNT\Microsoft.NET\Framework\[Framework Version]\CONFIG\machine.config
Vineet Kumar SainiPosted Jan 10, 2012, 6:28 AM
Javeed M ShaikhPosted Oct 17, 2011, 1:36 PM
The settings made in the Web.config file are applied to that particular web application only whereas the settings of Machine.config file are applied to the whole asp.net application.
Recommended articles from C#Corner:
http://www.c-sharpcorner.com/UploadFile/puranindia/WebConfigurationFile11112009054541AM/WebConfigurationFile.aspx
more differences can be found here:
http://24x7aspnet.blogspot.com/2009/06/difference-between-webconfig-and.html
Please do not forget to mark "Accepted Answer".