Australian cloud for business software — built and run in Sydney since 2002

NetLeverage
NetLeverage

IIS HTTP Error 500.19 "The requested page cannot be accessed": read the error code, then the config

Technical article
Troubleshooting

About this article: This article is reviewed against the cited sources. This is source research, not lab validation. Check the stated versions and your own requirements before making changes.

A site in IIS stops loading and returns:

HTTP Error 500.19 – Internal Server Error

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

Microsoft's list of IIS status codes says 500.19 comes from a problem in the applicationHost.config file or the Web.config file (Microsoft Learn, HTTP status codes in IIS). The same message covers several different faults. The part that tells them apart is the HRESULT code shown in the error.

What you see

  • The browser shows HTTP Error 500.19 – Internal Server Error, with an HRESULT code such as 0x8007000d or 0x80070021.
  • The IIS log records the status code. Microsoft says IIS keeps its logs by default in inetpub\logs\Logfiles, with one folder per site and one file per day.
  • Microsoft's causes are all configuration, module or permission problems. It follows that the first question is what changed on the site or server just before the error began.

Why it happens

Microsoft's 500.19 page says the error occurs when a website's configuration is invalid. It lists the common causes as malformed XML, locked configuration sections, insufficient permissions, duplicate entries and missing modules (Microsoft Learn, HTTP error 500.19 - Internal Server Error in IIS). Each HRESULT points to one of them:

HRESULT Microsoft's cause
0x8007000d Malformed or unrecognised XML in ApplicationHost.config or Web.config. Often a section for a module that is not installed, such as URL Rewrite, or a syntax error.
0x80070021 A configuration section is locked at a higher level and the site's Web.config tries to override it.
0x80070005 Permissions: the IIS_IUSRS group cannot read the configuration files or folders, or the site uses UNC pass-through authentication to a remote share.
0x800700b7 A duplicate entry for the same setting exists at a higher level. The error message shows where.
0x8007007e The configuration refers to a module or DLL that is invalid or does not exist.
0x800700c1 The module's bitness differs from the application pool's (for example, a 32-bit module in a 64-bit pool), or the module is corrupted.
0x8007010b The content directory can't be accessed.
0x8007052e The application's process identity can't open Web.config on a remote share.
0x80070003 IIS can't read the configuration file: permissions, or a physical path that does not match the virtual directory (for example, no Web.config under the app's root).

For an ASP.NET Core application, Microsoft says the likely cause is that the ASP.NET Core Hosting Bundle for the .NET version the app targets is not installed.

How to prove the cause

1. Write down the HRESULT and any file and line shown. Everything else follows from it.

2. Check the Application log. Microsoft's page says to open Event Viewer > Windows Logs > Application and look for WAS or IIS-W3SVC events at the time of the error. The event details often give the line number and XML element at fault.

3. Open the section in Configuration Editor. In IIS Manager, select the site and open Configuration Editor, then the section named in the error. Microsoft says that if it fails to load, the section is malformed or unrecognised.

4. Validate the configuration from the command line. Microsoft's page gives:

%windir%\system32\inetsrv\appcmd list config /section:system.webServer

5. Check for missing modules (0x8007000d, 0x8007007e). Look for section names such as <rewrite>, <compression> or <authentication>, and check that the matching IIS feature or module is installed. Module references are in C:\Windows\System32\inetsrv\Config\ApplicationHost.config. For 0x8007007e, Microsoft suggests turning on Failed Request Tracing and reproducing the error to find the bad reference.

6. Check permissions and paths (0x80070005, 0x8007010b, 0x8007052e, 0x80070003). Confirm the folder holding Web.config exists, matches the site's physical path, and that IIS_IUSRS or the application pool identity can read it. Microsoft suggests Process Monitor or Failed Request Tracing when you are not sure which path is failing.

The fix

Match the fix to the HRESULT. Microsoft says you only need the option that applies.

  • 0x8007000d, bad XML: go to the line in the error, correct the unclosed, misnested or misspelt tags, and validate the file in an XML-aware editor.

  • 0x8007000d, missing module: install the IIS module the section belongs to. If the module is not needed on this server, Microsoft's option is to comment out or remove that section.

  • 0x80070021, locked section: unlock it, either with

    %windir%\system32\inetsrv\appcmd unlock config /section:handlers
    

    (using the section named in your error), or in IIS Manager at the server node: Configuration Editor, select the section, then Unlock Section. If policy says it must stay locked, remove the section from Web.config and set it at the level where it is allowed. Microsoft notes that locks in an enterprise are often intentional; check with whoever owns the server's configuration before unlocking.

  • 0x80070005, permissions: grant IIS_IUSRS Read on the folder that holds the configuration file, and make sure the files inherit it. If the site uses UNC pass-through authentication, Microsoft says to use a specific account with access to the share instead.

  • 0x800700b7, duplicate: compare the file with its parent configuration and remove or rename the duplicate entry.

  • 0x8007007e, bad module reference: remove the invalid module or DLL reference.

  • 0x800700c1, bitness: use a module that matches the application pool's bitness, and check the module is not corrupted.

  • 0x8007010b, 0x8007052e, 0x80070003, paths and identity: correct the path, or the permissions of the application pool identity on it.

  • ASP.NET Core: install the ASP.NET Core Hosting Bundle for the .NET version the app targets.

If nothing else works, Microsoft's last option for bad XML is to copy a known-good configuration file from a working environment, or redeploy the application.

How to confirm the fix

  • The page loads, and the IIS log for the site shows the request without a 500 status.
  • appcmd list config /section:system.webServer runs without a configuration error.
  • The section that failed opens in Configuration Editor.
  • No new WAS or IIS-W3SVC errors appear in the Application log.

What to watch afterwards

  • Deployments. Microsoft lists manual edits and merges of configuration files from different environments as a cause of bad XML. Check Web.config changes before they reach the server.
  • New modules. A Web.config that uses a module (URL Rewrite, for example) needs that module installed on every server the site runs on. This follows from the 0x8007000d cause.
  • Updates. Microsoft's page advises backing up all configuration files, not only IIS ones, before installing any update, and taking a snapshot first if the server is a virtual machine.

Risks and limits

  • Microsoft warns that changes to ApplicationHost.config affect every site on the server. Back the file up before editing it. Editing overrideModeDefault from Deny to Allow in that file unlocks the section for every site. The appcmd command above and Unlock Section at the server node do the same: they unlock that section for every site on the server, so they are not narrower. To unlock it for one site only, leave the section where it is in applicationHost.config and name it inside a <location path="<SiteName>" overrideMode="Allow"> element. Microsoft's locking guide shows this form: Web.config files in that site can then override the section, while for every other site it stays locked (Microsoft Learn, How to use locking in IIS configuration).
  • Commenting out a section removes what it did. Microsoft offers it only where the module is not required or not available. It follows that a missing <rewrite> section can change how the site handles its addresses.
  • 500.19 is a configuration fault. Microsoft's status-code list describes 502 (an invalid response from a server behind a gateway or proxy) and 503 (service unavailable) separately; those are different problems.

Sources

Next step

With 500.19, the HRESULT is the diagnosis: look it up, then fix that one cause. NetLeverage has looked after business servers since 2002. If your site still won't load, talk to us through managed support with the full error page, including the HRESULT, and the matching Application log event.