locked
Error : The inheritInChildApplications attribute is not allowed RRS feed

  • Question

  • User-542735381 posted

    Hi,

    I am working on MVC 4 project. I just installed elmah package. I have an error in the web.config for the element <location path="elmah.axd" inheritInChildApplications="false">.   The error is  The inheritInChildApplications attribute is not allowed.

    I googled the error, somewhere said the <location> cannot be before or inside the <configSections>. But in my case, the <location> is after <configSections> and just before the </configuration>.

    Thank you.

    Friday, July 5, 2013 1:21 AM

Answers

  • User1957004874 posted

    Do you have the namespace defined on the configuration root node?

    It will be - <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">

     

    Also, did you use elmah.mvc nuget package for configuration? if not then I guess that will be the preferred way to do that, it will make all the necessary changes. Remember location config element will work in webform app but not in MVC because there is several possible route to reach a controller/action.

     

    In case required see the elmah configuration details here - http://beletsky.net/2011/03/integrating-elmah-to-aspnet-mvc-in.html

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, July 5, 2013 9:49 AM

All replies

  • User1957004874 posted

    Do you have the namespace defined on the configuration root node?

    It will be - <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">

     

    Also, did you use elmah.mvc nuget package for configuration? if not then I guess that will be the preferred way to do that, it will make all the necessary changes. Remember location config element will work in webform app but not in MVC because there is several possible route to reach a controller/action.

     

    In case required see the elmah configuration details here - http://beletsky.net/2011/03/integrating-elmah-to-aspnet-mvc-in.html

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, July 5, 2013 9:49 AM
  • User-542735381 posted

    Hi CPrakash82,

    Thank you veru much.

    I add  xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0"  into the <configuration>, the error has gone.

    Just I don't undersatand what you mean about  Remember location config element will work in webform app but not in MVC because there is several possible route to reach a controller/action.

    I use mvc, does thus mean the error page elamah.axd won't work? and how about the verb="post,get,head"? Would you please explain a litter bit? Thank you.

    Monday, July 8, 2013 7:44 PM
  • User1957004874 posted

    I use mvc, does thus mean the error page elamah.axd won't work? and how about the verb="post,get,head"? Would you please explain a litter bit?

    Refer the link provided it has all the reasons why we should not use location element, those reasons are not just limited to Elmah.

    Monday, July 8, 2013 9:03 PM