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
- Missing ASP.NET Core Hosting Bundle
- Invalid
web.config - Duplicate configuration sections
- Incorrect file permissions
- Missing IIS modules
- Incorrect publish folder
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:
- Download the Hosting Bundle that matches your .NET version.
- Install it.
- 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:
- XML is well-formed.
- DLL name matches your application.
- No duplicate sections.
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:
- Read
- Execute
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:
- Project targets the correct .NET version.
- The same runtime is installed on the server.
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:
- Clean Solution
- Rebuild Solution
- Delete old publish folder
- Publish again
- 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
- Install the correct Hosting Bundle.
- Match the server runtime with the project's target framework.
- Publish using the Release configuration.
- Test locally before deploying.
- Keep IIS and .NET updated.
Real-World Troubleshooting Checklist
Before spending hours debugging, verify:
- ASP.NET Core Hosting Bundle installed.
- Correct .NET runtime installed.
- Valid
web.config. - IIS Application Pool is running.
- Folder permissions are correct.
- Application starts locally.
- Event Viewer checked for detailed errors.
- Old publish files removed before copying the new build.
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.
Ask AlgoLassi and get an answer plus the tutorials worth studying next.
đŦ Comments
Sign in with Google to publish immediately, or comment anonymously and wait for approval.
Comments will appear here when available.