difference between web.config file and machine.config file
Loading
difference between web.config file and machine.config file
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Naimish MakwanaPosted Apr 25, 2024, 6:18 AM
The
web.configandmachine.configfiles are both configuration files used in .NET applications. They store configuration data in XML format, but they serve different purposes and have different scopes1234:web.config: This file specifies configuration settings for a particular web application and is located in the application’s root directory1. It can contain application-level configuration settings2. Each web application can have its own
web.configfile, and directories inside a web application can also haveweb.configfiles1. The settings inweb.configfiles are applied to that particular web application only3. These files are parsed at runtime, which means if you make any changes, the web application will load all the settings in the config file2.machine.config: This file specifies configuration settings for all of the websites on the web server1. It is located in
$WINDOWSDIR$\Microsoft.Net\Framework\Version\Config1. Only onemachine.configfile exists on a system and it stores the highest level of configuration settings2. The settings ofmachine.configapply to all web applications residing on the server3. The settings inmachine.configcan be overridden byweb.configsettings2.In summary, the
machine.configfile contains settings that apply to all applications on a server, while theweb.configfile contains settings that apply to a specific web application. The settings in aweb.configfile can override the settings in themachine.configfile.Thanks
Vishal YelvePosted Apr 24, 2024, 1:15 PM
Hi Kishan,
do refer below article
https://www.c-sharpcorner.com/UploadFile/8a67c0/web-config-vs-app-config-vs-machine-config/
https://www.c-sharpcorner.com/blogs/difference-between-webconfig-and-machineconfig-file1