Deploying an ASP.NET Core application to IIS is usually a straightforward process. However, when something goes wrong, the error messages can often be misleading. During one of my recent deployments of a .NET 10 Web API on Windows Server 2022, I encountered multiple issues that initially pointed towards a missing Hosting Bundle. After spending several hours troubleshooting, I realized the actual problem wasn't just one thing—it could have been any one of several configuration issues.
In this article, I'll walk you through the exact troubleshooting process I followed. Whether you're facing HTTP Error 500.19, AspNetCoreModuleV2 errors, Hosting Bundle issues, or your application refuses to load after deployment, this guide will help you identify the root cause step by step.
For reference, here's the environment I was working with:
Windows Server 2022
IIS 10
ASP.NET Core .NET 10 Web API
SQL Server
Visual Studio 2022
The Initial Problem
After publishing my application to IIS, opening the website immediately displayed the following error:
HTTP Error 500.19 - Internal Server Error
Error Code: 0x8007000d
At first, it looked like IIS couldn't read the application's web.config file. In many cases, this error also appears when the ASP.NET Core Hosting Bundle is missing or IIS cannot load the ASP.NET Core Module.
Instead of reinstalling everything immediately, I decided to troubleshoot the problem systematically.
Step 1: Verify the web.config File
The first thing I checked was the web.config file generated during publishing.
For an ASP.NET Core application hosted in IIS, it should look similar to this:
<aspNetCore
processPath="dotnet"
arguments=".\YourApplication.dll"
stdoutLogEnabled="true"
stdoutLogFile=".\logs\stdout"
hostingModel="InProcess" />
I carefully verified:
The DLL name matched the published application.
The XML structure was valid.
The hosting model was correct.
Stdout logging was enabled for troubleshooting.
Everything looked fine, so I moved to the next step.
Step 2: Check Whether the .NET Runtime Was Installed
The Hosting Bundle depends on the correct .NET runtime being installed.
To verify this, I opened Command Prompt and executed:
dotnet --list-runtimes
The output confirmed that both the ASP.NET Core Runtime and the .NET Runtime were installed.
Microsoft.AspNetCore.App 10.0.x
Microsoft.NETCore.App 10.0.x
If these runtimes are missing, your application will never start, regardless of IIS configuration.
Step 3: Verify the ASP.NET Core Hosting Bundle
Next, I checked whether the Hosting Bundle was installed.
Open:
Control Panel
→ Programs and Features
Look for something similar to:
Microsoft .NET 10.x Windows Server Hosting
If it isn't listed, download and install the correct Hosting Bundle for your .NET version from Microsoft.
If it is already installed, continue troubleshooting instead of reinstalling it immediately.
Step 4: Verify the ASP.NET Core Module
The Hosting Bundle installs the IIS module responsible for running ASP.NET Core applications.
Navigate to:
C:\Program Files\IIS\Asp.Net Core Module\V2
Make sure the following file exists:
aspnetcorev2.dll
If this file is missing, IIS won't be able to launch your application.
Step 5: Verify IIS Module Registration
Even if the DLL exists, IIS must register the module correctly.
Run the following command in PowerShell:
& "$env:windir\System32\inetsrv\appcmd.exe" list modules
Look for:
AspNetCoreModuleV2
If you don't see it, repairing or reinstalling the Hosting Bundle usually resolves the issue.
Step 6: Verify the Global Module Registration
Then verified that IIS had registered the module globally.
Open:
C:\Windows\System32\inetsrv\config\applicationHost.config
Search for:
<globalModules>
Inside the XML there will be section, you should find:
<add
name="AspNetCoreModuleV2"
image="%ProgramFiles%\IIS\Asp.Net Core Module\V2\aspnetcorev2.dll" />
If this entry is missing, IIS cannot load ASP.NET Core applications.
Step 7: Verify the IIS Website
Sometimes the simplest things are overlooked.
I checked whether my website was actually running.
Import-Module WebAdministration
Get-Website
The website status should be:
Started
If the site is stopped, start it before continuing.
Step 8: Verify the Application Pool
This turned out to be one of the most important checks.
I opened the Application Pool settings and found:
Managed Runtime Version : v4.0
For ASP.NET Core applications, this setting is incorrect.
The Application Pool should be configured as:
.NET CLR Version: No Managed Code
Managed Pipeline: Integrated
Enable 32-Bit Applications: False
Although ASP.NET Core doesn't use the .NET Framework runtime inside IIS, many deployments are still configured incorrectly with v4.0, which often causes confusion.
Step 9: Verify IIS Bindings
Next, I confirmed that the website bindings were correct.
I verified:
HTTP binding
HTTPS binding
Host name
SSL certificate
An incorrect host name or missing SSL certificate can prevent requests from reaching your application.
Step 10: Run the Application Outside IIS
This was probably the most useful step during the entire troubleshooting process.
Instead of relying on IIS, I ran the application directly.
cd C:\inetpub\wwwroot\YourApplication
dotnet YourApplication.dll
The application started successfully.
Starting Application...
Application started successfully.
This immediately told me that the application itself was healthy and that the problem was somewhere in IIS rather than the application code.
Whenever you're troubleshooting deployment issues, this should be one of the first tests you perform.
Step 11: Enable Stdout Logging
If the application fails to start inside IIS, enable stdout logging temporarily.
stdoutLogEnabled="true"
After making a request, check the generated log files inside:
logs
These logs often contain the exact exception that caused the application to fail.
Remember to disable stdout logging once the issue has been resolved.

Join the conversation! Your thoughts help the community grow.