Click here to Skip to main content
15,884,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Can you please post difference between Web.config and machine.config files?Please explain with examples
Posted

web.config: It is the main settings and configuration file for an ASP.NET web application. The file is an XML document that defines configuration information regarding the web application. The web.config file contains information that control module loading, security configuration, session state configuration, and application language and compilation settings. Web.config files can also contain application specific items such as database connection strings.

machine.config: It contains settings that apply to an entire computer. This file is located in the %runtime install path%\Config directory. Machine.config contains configuration settings for machine-wide assembly binding, built-in remoting channels, and ASP.NET.

hope it helps :)
 
Share this answer
 
Comments
RaviRanjanKr 10-Nov-11 6:28am    
My 5+
Uday P.Singh 10-Nov-11 12:16pm    
thank you Ravi :)
The machine.config is the ultimate master config file on your system with a lot of default settings.
When you use web.config files, it is for your application. It's advised to keep the machine.config as is as much as possible so to not get conflicts with other applications
 
Share this answer
 
v2
Comments
RaviRanjanKr 10-Nov-11 6:28am    
My 5+
The machine.config file is the master configuration file on your system with a lot of default settings. Web.config is the file for the local settings to be applied for a website which store configuration data in XML format.

The machine.config would be to share values between many applications on the server such as SMTP server settings while Web.config files contain application specific items such as database connection strings.

More about.......Difference between Machine.config and web.config

William
 
Share this answer
 
web.config is configure application only
machine.config file related to ur all d application on server

web.config file are applied to that particular web application only
machine.config file are applied to the all managed application

web.config file exists within the web application,
machine.config file exists in the
c:\windows\microsoft.net\framework\version\config file

The web.config file is a subset of machine.config written according to the same XML schema.
 
Share this answer
 
v5
Comments
RaviRanjanKr 10-Nov-11 6:27am    
[Edited]Minor editor for remove "pre" tag from normal sentence and wrapped some text in Code block[/Edited]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900