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:
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:
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:
<%@ 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



Author: Herman Schoenfeld