Problem:

After deployed a website on localhost, when visit the web, the following error occurred:

___________________________________________________________________________________

Error Summary

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
\\?\D:\CAT\CAT.WebApi\web.config

Requested URL
http://localhost:80/CatService/CatService.svc

Physical Path
D:\CAT\CAT.WebApi\CatService.svc

Logon Method
Not yet determined

Logon User
Not yet determined

Config Source

   69:   <system.webServer>
   70:     <modules runAllManagedModulesForAllRequests="true"/>
   71:     <!--

Screen shot:


      
  HTTP Error 500.19 - Internal Server Error
    

Solution:

1. Open control panel, go to “Programs and Features”;

2. Click “Turn Windows features on or off”;

3. On the “Turn Windows features on or off” panel, expand “Internet Information Services”, “World Wide Web Services”, “Application Development Features” in sequence.

4. Check the “ASP.NET” option, the other 3 options “.NET Extensibility”, “ISAPI Extensions”, “ISAPI Filters” would be automatically checked. Fixed: HTTP Error 500.19 - Internal Server Error

5. Click OK, and then revisit the web page, the error is gone.