Monday, September 15, 2008

Difference between Web.Config and Machine.Config

The .NET Framework uses on .config files to define configuration options. The .config files are text-based XML files.

Machine.configSystem-wide configuration settings for the .NET Framework are defined in the Machine.config file. The default settings that are contained in the Machine.config file can be modified to affect the behavior of .NET applications on the whole system. Configuration done in machine.config file is affected on any application that runs on a particular machine(local machine ). Usually, this file is not altered. The default path of the Machine.config file is
%SystemRoot%\Microsoft.NET\Framework\% VersionNumber%\CONFIG\

Web.configWhen we want to change the ASP.NET configuration settings for a single application then we create a Web.config file in the root folder of the application. This Web.config file will override the settings in the Machine.config file. An Asp .net application has one web.config file which keeps the configurations required for the corresponding application.