Difference between Web.Config and Machine.Config File
Hello, I have learned the .net and one of my interview time I was asked by the interviewer that tell me Difference between Web.Config and Machine.Config File?. It is not possible for me to answer this question. If anyone knows the difference then please provide me that. I think this concept is in the asp.net as that question is asked in the asp.net interview.
Re: Difference between Web.Config and Machine.Config File
I don't have that much knowledge about the .net but, I know that machine. config is a file which is configuration file and it comes under the IIS. And if you consider the web.config then it is the configuration file for a application or folder. So, you can simply come to know that machine.config is having the machine level configuration. And web.config is a application/folder level configuration.
Re: Difference between Web.Config and Machine.Config File
web.config: As you come to know from the extension that this is the configuration file and it is used in the Asp .net web application. This file is comes into the asp.net application and it is having configuration which is required for the corresponding application. Machine.config is Whole .Net Application specific. It is also a configuration file. If you are using this file then it will applicable for the entire machine.
Re: Difference between Web.Config and Machine.Config File
Difference between Machine.Config and Web.Config
Machine.Config:
- This file is get installed on your computer when you install the Visual Studio. Net.
- You can also call this file as machine level configuration file.
- A single file exist on server.
- This file comes in the higher level of hierarchy.
Web.Config:
- If you create any web application in asp.net this file gets created.
- You can also call this file as application level configuration file.
- You can inherit the setting from machine.config with the use of this file
Re: Difference between Web.Config and Machine.Config File
In web.config we can store following :
- Database Connection
- Session State
- Error handling
- Security
In machine.config we can store following:
- Connection strings
- Membership
- Role Manager
- Profile
- HTTP Handlers
Re: Difference between Web.Config and Machine.Config File
Machine.Config:-
- This file comes from the Visual Studio .net installation.
- You can refer this file as machine level configuration file.
- This file you can search in the server.
Web.Config:-
- This file gets created with your application.
- You can refer this file as application level configuration file.
- This file inherits setting from the machine.config