Introduction

Publishing an ASP.NET Core application to IIS is usually straightforward, but many developers encounter HTTP Error 500.19 when opening the deployed website.

The error indicates that IIS cannot read or process the application's configuration, most commonly the web.config file.

This guide explains the common causes of HTTP Error 500.19 and provides practical solutions to get your application running.


What is HTTP Error 500.19?

HTTP Error 500.19 means IIS cannot load the application's configuration.

Typical message:

HTTP Error 500.19

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

Common Causes


Solution 1: Install the ASP.NET Core Hosting Bundle

This is the most common solution.

If IIS doesn't have the ASP.NET Core Hosting Bundle installed, it can't run ASP.NET Core applications.

Steps:

  1. Download the Hosting Bundle that matches your .NET version.
  2. Install it.
  3. Restart IIS.
iisreset

After installation, publish the application again and test the site.


Solution 2: Verify web.config

A typical ASP.NET Core web.config should resemble:

<?xml version="1.0" encoding="utf-8"?>
<configuration>

  <system.webServer>

    <handlers>
      <add name="aspNetCore"
           path="*"
           verb="*"
           modules="AspNetCoreModuleV2"
           resourceType="Unspecified"/>
    </handlers>

    <aspNetCore processPath="dotnet"
                arguments="YourApp.dll"
                stdoutLogEnabled="false"
                hostingModel="InProcess" />

  </system.webServer>

</configuration>

Check:


Solution 3: Check the Hosting Model

Two hosting models are supported:

InProcess

and

OutOfProcess

Use the model appropriate for your application and hosting environment.


Solution 4: Verify Folder Permissions

The IIS Application Pool identity needs permission to access the published folder.

Recommended permissions:

If your application writes logs or uploads files, also grant write permission to those specific folders.


Solution 5: Enable stdout Logging

To diagnose startup failures:

stdoutLogEnabled="true"
stdoutLogFile=".\logs\stdout"

Create a logs folder in the published directory and ensure IIS can write to it.

Remember to disable stdout logging after troubleshooting to avoid large log files.


Solution 6: Verify the Target Framework

Ensure:

Example:

<TargetFramework>net9.0</TargetFramework>

If the server only has .NET 8 installed, the application won't start.


Solution 7: Republish the Application

Sometimes publish output becomes inconsistent.

Recommended process:

  1. Clean Solution
  2. Rebuild Solution
  3. Delete old publish folder
  4. Publish again
  5. Copy the new files to IIS

Solution 8: Check Event Viewer

If the browser only shows HTTP 500.19:

Open:

Windows Logs
    ↓
Application

Look for ASP.NET Core or IIS errors that provide additional details.


Common Error Codes

0x8007000d

Configuration file is invalid.


0x80070005

Access denied.

Usually caused by insufficient permissions.


0x80070021

Configuration section is locked.

Occurs when IIS settings conflict with web.config.


0x80070032

Unsupported configuration.

Often related to missing IIS features or modules.


Best Practices


Real-World Troubleshooting Checklist

Before spending hours debugging, verify:


Conclusion

HTTP Error 500.19 is one of the most common deployment issues for ASP.NET Core applications. In most cases, the problem is caused by a missing Hosting Bundle, an invalid web.config, incorrect permissions, or a mismatch between the application's target framework and the installed runtime. Following a structured troubleshooting process will usually resolve the issue quickly.


Frequently Asked Questions

What causes IIS HTTP Error 500.19?

It is typically caused by an invalid web.config, a missing ASP.NET Core Hosting Bundle, insufficient permissions, or missing IIS modules.

Does reinstalling the Hosting Bundle fix HTTP Error 500.19?

Yes. If the error is caused by a missing or outdated ASP.NET Core Module, installing the correct Hosting Bundle is often the solution.

Should I enable stdout logging?

Yes, but only while troubleshooting. Disable it afterward to prevent unnecessary log growth.

🤖 AlgoLassi Assistant Have a question about this tutorial?

Ask AlgoLassi and get an answer plus the tutorials worth studying next.

Ask a question

đŸ’Ŧ Comments

Sign in with Google to publish immediately, or comment anonymously and wait for approval.

Comments will appear here when available.