Vijay Yadav
Difference between Machine.config and web.config
By Vijay Yadav in ASP.NET on Feb 02 2011
  • Umar Ali
    Sep, 2012 1

    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

    • 0
  • sarika jain
    Feb, 2011 9

    Machine.config

    It is the file for the global settings for all the .NET framework applications on the computer.
    It is located in systemroot\Microsoft.NET\Framework\versionNumber\Config folder

    Web.config
    It is the file for the local settings to be applied only in a particular website or it can be said it is the settings to be applied for a website for the security purpose.Settings in web.config file override those in Machine.config file.

    • 0
  • Shivprasad
    Feb, 2011 3

    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

    • 0
  • Vijay Yadav
    Feb, 2011 2

    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.

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS