简体   繁体   中英

Handler Mapping For Classic Asp .asp extension pages giving errors at IIS Integrated Pipe Line Mode

I am trying to run classic Asp pages in the IIS 7 Integrated pipe line mode. Thus, I have added following Handler mapping into Web.Config.

add name="ASPClassic" 
path="*.asp" 
verb="GET,HEAD,POST" 
modules="IsapiModule" 
scriptProcessor="C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" 
requireAccess="Script"
resourceType="Unspecified" 

But, when .asp pages are being requested, Server Application Unavailable error is raised and the detailed application event log said that:

A request mapped to aspnet_isapi.dll was made within an application pool running in Integrated .NET mode. Aspnet_isapi.dll can only be used when running in Classic .NET mode. Please either specify preCondition="ISAPImode" on the handler mapping to make it run only in application pools running in Classic .NET mode, or move the application to another application pool running in Classic .NET mode in order to use this handler mapping.

Where did I go wrong?

The script processor for Classic ASP is not:

C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\aspnet_isapi.dll

but:

%windir%\\system32\\inetsrv\\asp.dll

Here's the correct handler mapping entry from IIS7's applicationHost.config file when Classic ASP is installed:

<add name="ASPClassic" 
     path="*.asp" 
     verb="GET,HEAD,POST" 
     modules="IsapiModule" 
     scriptProcessor="%windir%\system32\inetsrv\asp.dll" 
     resourceType="File" />

It sounds like you've not installed Classic ASP on your server or workstation.

On Windows 7 you need to go to Control Panel -> Programs and Features then click "Turn Windows features on or off". You'll get a window that looks like this, make sure "ASP" is ticked:

在此输入图像描述

On Windows 2008R2 go to Control Panel -> Administrative Tools -> Server Manager . Click on "Roles" in the left hand panel then scroll down to "Web Server (IIS)". There should be a list of "Role Services" like this (I've highlighted ASP which is installed on the server I took this screen shot from):

在此输入图像描述

If ASP is not installed then click on "Add Role Services" and tick the ASP checkbox under Web Server -> Application Development and click Next to complete the installation.

If all is well then you should see the Handler Mapping in IIS Manager:

在此输入图像描述

Could it be that in order to run classic asp pages in IIS 7 you still need to install that? (It is not Installed by Default on IIS 7.)

See here how to add the asp module depending on wether this your on windows7 or windows server 2008 : http://www.iis.net/configreference/system.webserver/asp

Btw: what you are trying to do is indeed script mapping in classic pipeline mode.
See also : http://www.iis.net/learn/application-frameworks/building-and-running-aspnet-applications/wildcard-script-mapping-and-iis-integrated-pipeline_

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM