37
votes

I changed PC / Windows (XP -> 7) so IIS (6 -> 7,5) and trying to move my website

But I can't run my site from this server . . . error :

Error description: Error HTTP 500.19 - Internal Server Error

The requested page is not available because of incorrect configuration data for this page.

Error Details Module IIS Web Core Notice BeginRequest Handler Not yet determined Error 0x80070021 Configuration error This configuration section can not be used in this way. This happens when the section is locked at the parent level. Locking is either by default (overrideModeDefault = "Deny"), or installed directly by the tag location with overrideMode = "Deny" or inherited property allowOverride = "false". The configuration file \ \? \ D: \ Projects \ Flow WEB \ Sources \ web.config The requested URL-address https: / / 192.168.0.172:443 / Physical Path D: \ Projects \ Flow WEB \ Sources Logon Method Not yet determined Users who have logged on yet to be determined Channel

Configuration

<handlers>   
<remove name="WebServiceHandlerFactory-Integrated" />

...

my web.config part :

    <modules>
        <remove name="ScriptModule" />
        <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    </modules>

    <handlers>
        <remove name="WebServiceHandlerFactory-Integrated" />
        <remove name="ScriptHandlerFactory" />
        <remove name="ScriptHandlerFactoryAppServices" />
        <remove name="ScriptResource" />
        <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add name="ScriptResource" verb="GET,HEAD" path="ScriptResource.axd" preCondition="integratedMode" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    </handlers>

So what's wrong ?

My trying : if I make it -

        <modules allowDefinition="MachineToApplication" overrideModeDefault="Deny">
        <remove name="ScriptModule"/>
        <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></modules>
    <handlers overrideModeDefault="Deny">
        <remove name="WebServiceHandlerFactory-Integrated"/>

I've got error : Unrecognized attribute "overrideModeDefault"

so I can't add it in configSections because it tells me that It already exist here.

and when I changed IIS to Read/Write (like on picture) Ive got a new error :

    Error description:
Error HTTP 404.3 - Not Found
The requested page can not be displayed because of the configuration expansion. If the page is a script, add a handler. If you need to download the file, add a MIME.
Error Details
Module StaticFileModule
Notice ExecuteRequestHandler
Handler StaticFile
Error 0x80070032
The requested URL-address https: / / 192.168.0.172:80 / Default.aspx
Physical Path D: \ Projects \ Flow WEB \ Sources \ Default.aspx
Anonymous Logon
Users who have logged Anonymous
The most likely reasons:

    * Perhaps there is no comparison handlers. By default, all content is processed by a handler static files.
    * Perhaps the component to which the access is not installed.
    * Corresponding MIME map is not activated for the website or application. Warning: Do not create a MIME map for content that users should not load - say, for the pages. ASPX or files. Config.
    * If ASP.NET is not installed.
8
Solution: I faced similar issue and finally this thread helped me, pretty simple solution though.stackoverflow.com/questions/25821187/…Shankar S

8 Answers

18
votes

Check this in the web.config and change overrideModeDefault from Deny to Allow.

<configSections>
  <sectionGroup name="system.webServer">
    <section name="handlers" overrideModeDefault="Deny" /> 
    <section name="modules" allowDefinition="MachineToApplication" overrideModeDefault="Deny" />

You can also manage sections on web server level in your IIS management console from "Feature Delegation".

50
votes

I had a problem with runAllManagedModulesForAllRequests, code 0x80070021 and http error 500.19 and managed to solve it

With command prompt launched as Admnistrator, go to : C:\Windows\Microsoft.NET\Framework64\v4.0.30319>

execute

aspnet_regiis -i

bingo!

16
votes

I had the same problem. Don't remember where I found it on the web, but here is what I did:

Click "Start button"

in the search box, enter "Turn windows features on or off"

in the features window, Click: "Internet Information Services"

Click: "World Wide Web Services"

Click: "Application Development Features"

Check (enable) the features. I checked all but CGI.

IIS - this configuration section cannot be used at this path (configuration locking?)

1
votes

I experienced the same issue, and found out that the applicationdeployed was of .NET version 3.5, but the Application pool was using .NET 2.0. That caused the problem you described above. Hope it helps someone.

My error:

HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid. Detailed Error Information
Module IIS Web Core 
Notification BeginRequest 
Handler Not yet determined 
Error Code 0x80070021 

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".  
Config File \\?\C:\inetpub\MyService\web.config 
Requested URL http://localhost:80/MyService.svc 
Physical Path C:\inetpub\DeployService\DeployService.svc 
Logon Method Not yet determined 
Logon User Not yet determined 
 Config Source
101:        </modules>
  102:      <handlers>
  103:          <remove name="WebServiceHandlerFactory-Integrated"/>
HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid. Detailed Error Information
Module IIS Web Core 
Notification BeginRequest 
Handler Not yet determined 
Error Code 0x80070021 
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".  

Config File \\?\C:\inetpub\DeployService\web.config 
Requested URL http://localhost:80/DeployService.svc 
Physical Path C:\inetpub\DeployService\DeployService.svc 
Logon Method Not yet determined 
Logon User Not yet determined 
 Config Source
  101:      </modules>
  102:      <handlers>
  103:          <remove name="WebServiceHandlerFactory-Integrated"/>`
1
votes

For me it was a fresh NetCore application that was just not loading via IIS. When run standalone it was OK though.

I removed the <aspNetCore line and then I got a normal error message from IIS saying that NetCoreModule could not be loaded. That module is required to understand this new web.config line.

The error message 0x8007000d actually says that the web.config is malformed and that error shows up before the error loading module making this error message really crap. (and an unfortunate race condition problem)

I installed the NetCoreSDK and stopped and started IIS (restart didnt work)

The NetCore API started working via IIS as expected.

0
votes

I had the same problem.

Solution:

  1. Click the right button in your site folder in "iis"
  2. "Convert to Application".
0
votes

If you have python, you can use a package called iis_bridge that solves the problem. To install:

pip install iis_bridge

then in the python console:

import iis_bridge as iis
iis.install()
0
votes

I got similar error when i run legacy application in Visual studio 2013 iis express and solved the issue by following steps 1.Navigate to "Documents\IISExpress\config" 2.Open "applicationhost.config" using notepad or any preferred editor 3.scroll down and find for section name="anonymousAuthentication" under 4. Update overrideModeDefault="Deny" to "Allow" 5. save the config file 6. Run the legacy application and worked fine for me.