Difference between Machine.config and web.config
Vijay Yadav
Please refer to the following link to know the differences between machine.config and web.config,http://onlydifferencefaqs.blogspot.in/2012/07/aspnet-difference-faqsdoc.html
Machine.config
In this .NET Interview question interviewer expects two things. First the importance of configuration and second in which scenarios are the above file applicable. So lets answer the question in two parts.
The importance of config files==================================================App.config, web.config and machine.config are files which store configuration data in XML format. We need configuration data at application level or at machine/server level.
Scenarios in which the above config files are used===================================================Machine.config file stores configuration information at system level. It can contain configuration information like timeout in ASP.NET application, requestLimit, memoryLimit, and ClientConnectedCheck etc.
Generally we have two kinds of application web application and windows application. Web.config file stores configuration data for web applications and app.config file store configuration information for windows application.
Application level configuration data can be like connection strings,security etc.
Some connected questions from this question which the interviewer can ask================================================================================Where do you store connectionstring ?.How do you encrypt connection string?How do you read configuration data from web.config or app.config file in .NET ?Can we have two web.config files for a web application.
Read my 100 .NET Interview questions and answers
The main difference between Machine.config and web.config is as follows:Machine.config is machine level config file,means if you make any changes into this file, it will applicable for all application which exists on same machine.
While Web.config settings only applicable for application level.This file is best place to keep your connection string and SMTP like settings and so on.