Thursday 29 September 2011

What is the difference between web.config and machine.config


This is a common question asked in ASP.Net interviews.

Web.config and machine.config are two files used for managing configuration of web applications.

Machine.config:

1. The configurations mentioned in machine.config file are applicable to all the applications hosted in a machine/computer/server.

2. The machine.config file is located in x:\\Microsoft.NET\Framework\\config\machine.config

3. There can be only one machine.config file per machine (per dotnet framework installed).

web.config:

1. web.config file contains configurations for a single application.

2. Web.config files overrides the configurations mentioned in machine.config file.

3. The web configuration file is located in your application's root folder

4. There can be multiple web.config files in a single web application in different sub folders.

No comments:

Post a Comment