priyanka.bangalore
priyanka.bangalore

Reputation: 1479

Question about machine.config file

It is known that we use web.config file to override the setting of machine.config file.

My questions are

a) how come machine.config file knows that only changes made in web.config file are to be overwritten. I mean to say, if I use some other name for the config file say xyz.config, will it be able to work?

b) How does machine.config file know about web.config? Is there any link mentioned inside the machine.config file for that?

Upvotes: 0

Views: 210

Answers (1)

Prashant Lakhlani
Prashant Lakhlani

Reputation: 5806

Machine.config file is basically a base class of your web application configuration that is inherited by the web.config file. Again web.config file is also converted to a class.

So that way, if a setting is not overloaded by the web.config class, it will be available from base class (machine.config) and otherwise it is taken from child class (web.config)

I'm not too goo the explain this OOP concept but I think this is how you can think of it.

hope this helps

Upvotes: 2

Related Questions