Here in this post we will discuss about difference between machine.config file and web.config file in asp.net.
Also you can check Exception handling in C#.Net, Object Oriented Programming (OOP) concepts in .Net and Array and ArrayList in C#.Net.
Machine.config:
- It gets created at the time of Visual Studio installation.
- There can be only one machine.config file exists in a server.
- This is only for machine level configuration like requestLimit, memoryLimit, ClientConnectedCheck etc.
Machine.config file located in below location:
\WINNT\Microsoft.NET\Framework\[Framework Version]\CONFIG\machine.config
Example:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config
Web.config:
- This got created when you create a web application project.
- This contains information for the application level. And this file inherits setting from the Machine.config file.
- we can store information like Database connection string, session details etc in web.config file.
Some points to remember:
- The settings made in the Web.config file are applied to that particular web application only whereas the settings of Machine.config file are applied to the whole asp.net application.
- web.config file inherits settings from machine.config file.
Also you can check Exception handling in C#.Net, Object Oriented Programming (OOP) concepts in .Net and Array and ArrayList in C#.Net.
Machine.config:
- It gets created at the time of Visual Studio installation.
- There can be only one machine.config file exists in a server.
- This is only for machine level configuration like requestLimit, memoryLimit, ClientConnectedCheck etc.
Machine.config file located in below location:
\WINNT\Microsoft.NET\Framework\[Framework Version]\CONFIG\machine.config
Example:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config
Web.config:
- This got created when you create a web application project.
- This contains information for the application level. And this file inherits setting from the Machine.config file.
- we can store information like Database connection string, session details etc in web.config file.
Some points to remember:
- The settings made in the Web.config file are applied to that particular web application only whereas the settings of Machine.config file are applied to the whole asp.net application.
- web.config file inherits settings from machine.config file.