How to Enable the Correct Dynamic Handler in IIS

A dynamic-page failure does not always mean the file is absent. IIS also needs the correct runtime and handler. The IIS 6 Web Service Extensions instructions do not apply directly to current IIS.

Identify the application before installing anything

Use the application's deployment documentation, not only its filename, to identify the stack:

Application Required path
Classic .asp Classic ASP role service and the ASPClassic handler
ASP.NET Framework .aspx Matching .NET Framework ASP.NET role services and compatible pool configuration
ASP.NET Core Supported .NET Hosting Bundle and published application's generated configuration

ASP.NET Core is not enabled by installing the Classic ASP feature.

Inspect the server and handler mapping

Run on the server using elevated Windows PowerShell:

PowerShell
Import-Module ServerManager
Get-WindowsFeature Web-ASP, Web-Asp-Net45

$appcmd = Join-Path $env:windir 'System32\inetsrv\appcmd.exe'
& $appcmd list config 'Default Web Site/Demo' /section:system.webServer/handlers

Replace the application path with the actual deployment. If the application is confirmed to be Classic ASP and the role service is absent, install that feature:

PowerShell
Install-WindowsFeature Web-ASP

For ASP.NET Framework, install the matching role service instead. For ASP.NET Core, follow the Hosting Bundle installation and deployment sequence, including its stated restart requirements.

Prove the selected handler works

For a Classic ASP test application, create probe.asp containing:

Visual Basic
<%@ Language="VBScript" %>
<% Response.ContentType = "text/plain" : Response.Write "ASP handler OK" %>

Request that exact URL. A successful result is an HTTP 200 response containing ASP handler OK, not the literal ASP source. Remove the probe after testing.

If the request still fails, inspect the IIS status and substatus, the application's physical path and its effective handler mappings. Do not enable every dynamic extension, grant Everyone access or add a static MIME mapping for executable source as a generic fix. Those changes can create new exposure without correcting the selected runtime.

References

ASP &lt;asp&gt;
Overview The &lt;asp&gt; element specifies configuration settings for an ASP application. These include developer-focused configuration settings, such as att...
https://learn.microsoft.com/en-us/iis/configuration/system.webserver/asp/
Classic ASP configuration
Configuring Step 1: Install IIS and ASP.NET Modules
This article describes configuration and installation of IIS and ASP.NET modules.
https://learn.microsoft.com/en-us/iis/application-frameworks/scenario-build-an-aspnet-website-on-iis/configuring-step-1-install-iis-and-asp-net-modules
Install IIS and ASP.NET modules
Publish an ASP.NET Core app to IIS
Learn how to host an ASP.NET Core app on an IIS server.
https://learn.microsoft.com/en-us/aspnet/core/tutorials/publish-to-iis
Publish ASP.NET Core to IIS

Author: Herman Schoenfeld