Search code examples
asp.netconfigurationiis-7asp-classiciis-7.5

How do I process .asp extensions using the .Net handler?


I have an older classic ASP website that I am migrating over to IIS7.5. I don't feel like installing classic ASP on the server, and so I just want the .asp files to be treated as if they were .aspx files.

How do I go about doing this in IIS7.5?

EDIT: To clarify, I am NOT asking how to get classic ASP code to work under .Net. I am just asking how to map the .ASP file extension to be handled by the .net runtime. I will upgrade the code in the .asp files to .net.

EDIT:

I gave up and ended up installing classic ASP, as I couldn't get the mapping to work (received a combination of 404.17 and 404.3 errors). I marked David Lively's answer as correct as it was the most detailed and helpful.


Solution

  • That's not going to work. Aspnet_isapi.DLL, which handles executing ASP.NET applications, doesn't understand classic ASP, and will try to parse the classic VBScript code as .NET VBScript.

    The only way this is feasible is if you have no (and I mean ABSOLUTELY NONE) classic ASP code in your .ASP pages.

    If that is the case, you can map the .ASP extension to aspnet_isapi in IIS manager.

    1. Open inetmgr.
    2. Select the website
    3. In the Feature View panel, select "Handler Mappings" alt text
    4. Add a mapping for .ASP to C:\Windows\microsoft.net\framework\v2.0.50727\aspnet_isapi.dll (assuming you're using ASP.NET 2.x).

    Again, if you have any code in your .asp pages, this will cause a glorious, technicolor failure for every .ASP page.

    Another option is to use a rewrite engine (we use ISAPI Rewrite) to change the file extension of incoming requests from from .asp to .aspx.

    Why don't you want to install classic ASP on the server? It works just fine in parallel with ASP.NET.

    edit

    It's actually called "handler mappings." See image above.