I recently setup an ASP.Net 3.5 web application on a new Windows 2008 R2 server with IIS 7 and ran into a few issues.  I will post about them all under the tag: “asp.net 3.5 with iis 7“.

After setting up the file system and creating the application, I tried to load the default document in a browser and got:

HTTP Error 500.19 – Internal Server Error

The requested page cannot be accessed because the related configuration data for the page is invalid.

Module IIS Web Core
Notification BeginRequest
Handler Not yet determined
Error Code 0×80070021
Config Error This configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by default (overrideModeDefault=”Deny”), or set explicitly by a location tag with overrideMode=”Deny” or the legacy allowOverride=”false”.

Module IIS Web Core Notification BeginRequest Handler Not yet determined Error Code 0×80070021 Config Error This configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by default (overrideModeDefault=”Deny”), or set explicitly by a location tag with overrideMode=”Deny” or the legacy allowOverride=”false”.

The solution was to make a change in the applicationHost.config file.

  1. Browse to “C:\Windows\System32\inetsrv\config” (you will need administrator rights here)
  2. Open applicationHost.config
  3. Find the section that showed up in the “config source” part of the error message page.  For me this has typically been “modules” or “handlers”
  4. Change the overrideModeDefault attribute to be “Allow”
  5. So the whole line now looks like:
  6. <section name="modules" allowDefinition="MachineToApplication" overrideModeDefault="Allow" />

After saving the file, the page loaded up fine in my browser.


16 Responses to “ASP.Net Config Error: "This configuration section cannot be used at this path."”  

  1. 1 irwan

    Thank You

  2. 2 Yuri

    That saved me lots of time. Thank you

  3. 3 Saud

    This solution is not working for me i am still getting the same error and i have no idea how to resolve this. IIS 5.0 was lot more better i wonder why microsoft designs IIS 7.0.

  4. 4 Rishabh

    hi
    after the changes made to the file as you shown above,i encountered error 400.3 which i corrected in IIS setting by going at Program and Features -IIS-worldwideweb services-App dev and features…
    Now Latest that i have got after correcting it is as under

    HTTP Error 500.23 – Internal Server Error
    An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode.
    if you could help me in resolving this issue

  5. 5 Derek

    Hi, I can’t get my host to change windows server files so how do I fix this?

  6. 6 Mathew

    @Rishabh and also for any other googlers who reach here looking for a solution can refer to the below link for a solution..
    http://www.netomatix.com/Development/IIS7_404Error.aspx

  7. 7 Sai Krishna

    Thanks alot:) Saved lots of time:)

  8. 8 Ehsan

    Thanks a lot….

    Wasted a lot of time with this problem until I read this post…

  9. 9 Tauseef

    I had the same problem. I fixed it by going to turn on/off windows features and enabling the needed features like the framework and the state services.

  10. 10 Govind

    Great work! thanks a Lot :)

  11. 11 Aayush Bahuguna

    Thanks a lot :)

  12. 12 Digit

    I am using a nested asp.net 4.0 application under an existing asp.net application subfolder. The error only occurs when I call any DomainService function. This only happens on the web hosting site after I FTP the files there.

    Let me stress that:
    - Everything works fine on my local IIS (after I publish it there)
    - My local IIS has the same directory and file structure as the remote site for the parent/child nested setup.
    - I’ve never made changes to my applicationHost.config entry and it looks like this

    So if it overrideModeDefault=”Deny” on my local machine and everything works then this is not a solution to the real underlying problem. I am seeking a way to fix this error by only using the web.config files for my applications.

  13. 13 abba

    really helpful, thanks

  14. 14 Richa

    Hi…
    after follow your way to change in apphost file. i got below error..

    HTTP Error 403.14 – Forbidden
    The Web server is configured to not list the contents of this directory.

    pls find the way…

  15. 15 nasir

    thanks,
    partially working, now fall into another error.

  1. 1 Confluence: Microsoft Windows

Leave a Reply