3

I have a few applications that are set up using elmah for error handling. I recently read that Web.config files inherit from parent applications/directories, and decided to test it so that I can change elmah's settings in one place (since all the current Web.configs are identical when it comes to the elmah configuration). After creating a virtual directory in IIS7, nesting all my applications under it, and creating a stand-alone Web.config file in the physical folder, I tried testing it.

After removing the elmah specific configurations from one of the applications, I found that elmah stops working altogether. Just to see if it was something I did wrong, I created a connection string in the parent Web.config file, then called the connection string through code in the application. No issues. Inheritance was working fine. I tried adding all the elmah specific configurations back in, and removing them one at a time, but it kept complaining every time I removed something.

The question I have is:

Can only certain settings be inherited from the parent Web.config?

If not, am I just not comprehending how inheritance works with nested Web-configs?

I wanted to ask if it's an issue with me before I ask about it on the elmah site.

Sivvy
  • 853
  • 9
  • 28

1 Answers1

0

You should check this answer, it will maybe help you.

Also, in your child web.config, make sure that you do copy the configsections for Elmah (or make sure they are properly inherited). Otherwise, the elmah sections in your child web.config might not work (not entirely sure about that though)

Community
  • 1
  • 1
Superzadeh
  • 1,106
  • 7
  • 23