Machine / Web config Example, Difference between Web.config and Machine.config

Configuration files are used to control and manage the behavior of a web application.
  1. Machine.config:This is automatically installed when you install Visual Studio. Net.This is also called machine level configuration file. Only one Machine.config file exists on a server.This file is at the highest level in the configuration hierarchy.
  2. Web.config:This is automatically created when you create an ASP.Net web application project. This is also called application level configuration file. This file inherits setting from the Machine.config
Difference between Web.config and Machine.config:
  • 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.
  • Web.config file Setting of asp.net all project Machine.config are setting of server setting and when the web side are implemented time it work all project but Web.config file set all projects
  • Web config will be for that particular aplln whereas the Machine .config will for the whole machine
  • Every ASP.NET application that you has a Web.config file . The settings specified in this will imply only to that application.Whereas Your System will have a Machine.config file in Microsoft.NET\Framework\v1.1.4322\CONFIG Folder which contains specifications and settings at a system level.
  • Web.config file is to override the settings from the Machine.config file. Machine.config file settings are applied to all the webapplications residing on the server while Web.config settings are application specific.
  • Machine. config is configuration file for all the application in the IIS. but Web.config is a configuration file for a application or folder.
  • Machine.config for machine level configuration. but Web.config for a application/folder level configuration
Tags: ,
Hot on Web:


About author