Solution for HTTP Error 500.19 - Internal Server Error

Error Message:

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\wwwroot\web.config

Requested URL http://localhost:8081/

Physical Path C:\inetpub\wwwroot\

Logon Method Not yet determined

Logon User Not yet determined

Config Source

144: </modules>

145: <handlers>

146: <remove name="WebServiceHandlerFactory-Integrated"/>

Reason:

ERROR CODE: 0x80070021 is

ERROR_LOCK_VIOLATION The process cannot access the file because another process has locked a portion of the file.

Solution:

There are usually a few more lines in that error response that points to the exact line in the config file (and hence the locked section) that has the problem. You will either have to unlock that section or not use it in your application’s web.config file.

For e.g., one can lock/unlock handlers/modules sections by either

Ø use appcmd.exe

%windir%\system32\inetsrv\appcmd unlock config -section:system.webServer/handlers

%windir%\system32\inetsrv\appcmd unlock config -section:system.webServer/modules

OR

Ø manually change value from "Deny" to "Allow" for below settings in %windir%\system32\inetsrv\config\ applicationHost.config

<section name="handlers" overrideModeDefault="Deny" />

<section name="modules" allowDefinition="MachineToApplication" overrideModeDefault="Deny"/>

You can also configure the locking via IIS manager UI.

For more details refer: Locking in IIS 7.0 Configuration

In above error message, the error occurred on the handlers section at:

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

This usually indicates that ASP.NET is either not installed or has corrupted/incomplete installation because installation of asp.net unlocks that section. Hence if this is the case, one should install asp.net feature from Server Manager (Under Web Server Role in Windows Server 2008 and in Program Features-> Application server in Vista/Windows7). This KB929772 talks about the ASP.NET installation failure reason.

Comments

Popular posts from this blog

Implement Logging in CSV file using Nlog in .net core MVC application- part 2

Implement Nlog in .Net core MVC application part 1

Angular User Session Timeout example step by step

Restore the lost focus of Auto post back controls in asp.net update Panel control

Disable backspace key using Jquery