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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Anuja PawarRank #1,404 · 1.2K reputationPosted Jan 10, 2012, 2:30 AM EST
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.
Javeed M ShaikhRank #839 · 2.7K reputationPosted Oct 17, 2011, 9:36 AM EDT
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".
Vineet Kumar SainiRank #257 · 9.8K reputationPosted Jan 10, 2012, 1:28 AM EST
Ankit Shivnakr87 reputationPosted Jan 10, 2012, 2:34 AM EST
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