Skip to content

Feature Enhancement - Improve IIS error reporting when AspNetCoreModuleV2 is missing #63672

@ravirajd876

Description

@ravirajd876

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

Summary

When AspNetCoreModuleV2 is missing in IIS (e.g., Hosting Bundle not installed), IIS and "appcmd" only report a vague “Configuration error” with no details. This makes root cause analysis extremely difficult in production. A clearer error pointing to the missing Hosting Bundle would greatly improve diagnostics.

Description

Problem
When deploying an ASP.NET Core 8 app to IIS, if the server does not have the ASP.NET Core Hosting Bundle installed (so AspNetCoreModuleV2 is missing), the site’s web.config with element causes IIS to throw a generic error.

For example, running:
%windir%\system32\inetsrv\appcmd list config "Default Web Site/MyApp"
returns only:
ERROR (message: Configuration error
Filename: D:...\web.config
Line Number: 0
Description: )

This gives no actionable information. It does not indicate that the aspNetCore handler is unrecognized or that the Hosting Bundle is missing.

#area-IIS#Enhancement#aspnetcore#deployment

Describe the solution you'd like

IIS / ANCM should report a clearer error, such as:
Unrecognized configuration section 'system.webServer/aspNetCore'.
Ensure the ASP.NET Core Hosting Bundle is installed and AspNetCoreModuleV2 is available.

Additional context

Reproduction Steps

1. On a clean Windows Server (2019/2022) with IIS installed but without the .NET Hosting Bundle:
Add-WindowsFeature Web-Server, Web-Asp-Net45

2. Create a new IIS site (e.g. MyApp) and add this web.config to its root folder:

3. Run
%windir%\system32\inetsrv\appcmd list config "Default Web Site/MyApp"

4. Observe the output:
ERROR (message: Configuration error
Filename: D:...\web.config
Line Number: 0
Description: )

Expected Result

A clear error message that indicates the aspNetCore section is not recognized because AspNetCoreModuleV2 is missing. Example:
Unrecognized configuration section 'system.webServer/aspNetCore'.
Ensure the ASP.NET Core Hosting Bundle is installed.

Real-World Impact

  1. In our production environment, the Hosting Bundle was not properly registered, and the AspNetCoreModuleV2 handler was missing.
  2. The IIS Manager GUI showed only a generic “configuration error” with no details.
  3. Running appcmd list config gave the unhelpful output shown above (empty description).
  4. This made it extremely difficult to diagnose. We had to spend hours checking configs, comparing UAT vs PROD, and even reinstalling IIS features before finally discovering the root cause.
  5. A clearer message pointing directly to the missing Hosting Bundle would have saved several hours of downtime and troubleshooting in a production-critical environment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsfeature-iisIncludes: IIS, ANCM

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions