Tuesday, 3 April 2012

web.config vs app.config vs machine.config

web.config vs app.config

1. web.config is used with web applications while app.config is used for windows applications.
2. You can have more than one web.config file in your application. You can have a web.config for each folder under your web application. But there is always one app.config file in a window application.
3. If you make any changes to the web.config, web application will immediately load the changed config. But in case of app.config, you will have to restart the application.
4. web.config file is automatically added to the application while app.config is not automatically added. You can go to the solution explorer and select 'Add new item' and add the 'Application Configuration File'.

web.config vs machine.config

machine.config

1) This is automatically installed when you install. Net Framework.It is installed at Microsoft.NET\Framework\v1.1.4322\CONFIG. It contains default and machnine-specific values for all supported setting.
2)Only one machine.config file can exist on a server.
3) This file is at the highest level in the configuration hierarchy.
4) Its like a common repository for standard items and its over ridden by web.config file.
5) With out the Machine.Config file Application can not be executed.
6)Machine.config is also an XML file like web.config.

web.config

1) This is automatically created when you create an ASP.Net web application project.
2)This file inherits the settings from the machine.config and can override them as required.
3)With out the Web.Config file, Application can still be executed.

No comments:

Post a Comment