我该如何处理使用.net处理.asp的扩展? [英] How do I process .asp extensions using the .Net handler?

查看:178
本文介绍了我该如何处理使用.net处理.asp的扩展?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个旧的传统的ASP网站,我迁移到IIS7.5。我不觉得像在服务器上安装传统的ASP,所以我只是想,如果他们是.aspx文件的.asp文件来对待。

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.

我如何去在IIS7.5这样做呢?

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

编辑:为了澄清,我不是问怎么走传统的ASP code的.Net下工作。我只是问如何映射.ASP文件扩展名由.NET运行库处理。我将在.asp文件升级code到.NET。

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.

编辑:

我放弃了,结束了安装传统的ASP,因为我无法得到映射工作(接收到的404.17和404.3错误的组合)。我标志着大卫·莱弗利的答案正确的,因为它是最详细和有益的。

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.

推荐答案

这是行不通的。 ASPNET_ISAPI.DLL,它处理执行ASP.NET应用程序,不理解传统的ASP,并会尝试解析经典的VBScript code作为.NET的VBScript。

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.

这是可行的唯一方法是,如果你没有(我的意思的绝对没有)在你的.asp页传统的ASP code。

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

如果是这样的话,您可以映射.asp扩展在IIS管理器来aspnet_isapi。

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


  1. 开启INETMGR。

  2. 选择网站

  3. 在功能视图面板中,选择处理程序映射

  4. 添加.ASP映射到 C:\\ WINDOWS \\ microsoft.net \\框架\\ V2.0.50727 \\ ASPNET_ISAPI.DLL (假设你使用ASP.NET 2.X)。

  1. Open inetmgr.
  2. Select the website
  3. In the Feature View panel, select "Handler Mappings"
  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).

另外,如果有任何 $ C $在你的.asp页C,这将导致对每个.asp页辉煌,Technicolor的失败。

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

另一种选择是使用重写引擎(我们使用 ISAPI重写)来改变文件扩展名从名从.asp为.aspx传入的请求。

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.

为什么你不希望在服务器上安装传统的ASP?它工作得很好并联ASP.NET。

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

修改

它实际上是所谓的处理程序映射。见上图。

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

这篇关于我该如何处理使用.net处理.asp的扩展?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆