Skip Navigation LinksHome > Articles > Asp.net > Difference between Web.config and Machine.config

Difference between Web.config and Machine.config

Web.Config and Machine.Config file

By mamta_gupta   On   Friday, 04 September 2009

Page Views : 793   |   Technologies : Asp.net

Rating : Rated :
1

   Configuration files are used to control and manage the behavior of a web application.
   1.   Machine.config
   2.   Web.config

Machine.Config

One Machine.config file is shared for all ASP.NET's Application. It is only one on the machine for each version of .NET Framework. If you apply anything in machine.config file then it is applied on all ASP.NET applications. Machine.config file is universal on the machine. It can be located  in the %runtime install path%\Config directory.


1.   This is automatically installed when you install .NET Framework or Visual Studio. Net.
2.   This is also called machine level configuration file.
3.   Only one machine.config file exists on a server/computer.
4.   This file is at the highest level in the configuration hierarchy

Web.Config
Web.config file is only for particular ASP.NET application. each ASP.NET application has different file. One ASP.NET application can have more than one web.config file. But only one in one folder.

1.   This is automatically created when you create an ASP.Net web application project.
2.   This is also called application level configuration file or folder level configuration file.
3.   This file inherits setting from the machine.config. If same setting key is defined in both Machine.Config and Web.config, the Web.Config setting is used.

Difference Between Machine.config and Web.config

Machine.config is automatically installed when you install .NET Framework or Visual Studio. Net.

Web.config is automatically created when you create an ASP.Net web application project.


Machine.config is called machine level configuration file. Only one machine.config file exists on a server.

Web.config is called application level configuration file.

Machine.config file is at the highest level in the configuration hierarchy.


Web.Config  file inherits setting from the machine.config


Keywords :
Tags :
Rate This Article :

Comments :

# 1 Annonymous Wrote on 09/04/2009


nice article. it helps. keep it on.



# 2 ram99988 Wrote on 07/29/2010


Nice one



Write a Comment / Question / Feedback ...


User Login
Username :
Password :
Register Login

Forgot Password


Related Articles