What is the difference between web.config and machine.config?
I have read that:-
The web.config files specify configuration settings for a particular
web application, and are located in the application’s root directory;
the machine.config file specifies configuration settings for all of
the websites on the web server, and is located in
$WINDOWSDIR$\Microsoft.Net\Framework\Version\Config.
Is there anything which I am missing or any other technical aspect? I want to know more about both the files.
Each CLR version has a
machine.configfile, along with an additionalweb.configfile, which I refer to as the “machine level web.config file”.Additionally, as you note, each web application also has a
web.configfile. Directories inside a web application can also haveweb.configfiles too.Now, the key point is that config files inherit from each other. That means, a web application will read settings defined in the
machine.configfile and the machine levelweb.configfile (for its given framework version), and its ownweb.configfile.A common use case for defining things in the
machine.configwould be to share values between many applications on the server, like a connection string perhaps, or SMTP server settings, things like that.