Google News
logo
ASP.NET - Interview Questions
Explain the difference between Web.config and Machine.config file?
There is some key difference between Web.config and Machine.config file below :
 
The machine.config record is the master configuration document on your framework with a lot of default settings.And Web.config is the file for the local settings to be applied for a website which store configuration information in XML format.

The settings of Machine.config file are applied to the entire asp.net applications on your server while the settings made in the Web.config file are applied to that specific web application only.

Each .NET Framework form has only one machine.config file, simultaneously, each web application has its own web.config file. Directories inside a web application can have web.config files as well.

The machine.config is shared values among numerous applications on the server, while Web.config documents contain application explicit things, for example, database connection strings.

Suppose if you want any improvements in the web.config, then the web application will promptly load the changes but in the machine.config case you should restart the application.

The machine.config document will automatically introduce when you install Visual Studio.Net and it resides in the c:\windows\microsoft.net\framework\version\config folder whereas web.config will automatically be made when you make an ASP.Net web application project.

Machine.config is the design configuration file for all the applications in the IIS, but Web. config is a configuration file for a specific application.
Advertisement