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

后端 未结 4 1557
日久生厌
日久生厌 2021-01-26 09:56

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

4条回答
  •  误落风尘
    2021-01-26 10:33

    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.

提交回复
热议问题