无法在 IIS 中成功启动经典 ASP 应用

unable to successfuly launch classic ASP app in IIS

过去两天我一直在研究这个问题。我已经查看了许多类似的问题,并且已经完成了显示为答案的所有内容,但我仍然无法正确使用我的 class .asp 应用程序。

我可以启动我的网络应用程序 - 第一页是登录页面,我输入凭据(有效)单击“确定”然后它加载,我收到以下错误:

An error occurred on the server when processing the URL. Please contact the system administrator. If you are the system administrator please click here to find out more about this error.

点击这里 link 是这样的:https://docs.microsoft.com/en-us/iis/application-frameworks/running-classic-asp-applications-on-iis-7-and-iis-8/classic-asp-not-installed-by-default-on-iis

它告诉我我没有安装 classic ASP - 所以我按照说明进行操作,另外还查看了 SO 上的其他类似问题并确实这样做了:

太好了,接下来我遇到了另一个问题 - How to enable ASP classic in IIS7.5

这是我所做的:

So to resolve this issue, go to the website you want to add your application to, then double click on Handler Mappings. Click "Add Script Map" and enter in the following information:

RequestPath: *.asp Executable: C:\Windows\System32\inetsrv\asp.dll Name: Classic ASP (this can be anything you want it to be)

像这样:

但是,我仍然遇到同样的问题。我在 IIS 中添加了一个新站点,然后添加了我的经典 .ASP 文件的目录。要启动它,我单击右侧的“开始”,如下所示:

我点击 BROWSE 并打开 LOGIN 页面,再次正确打开登录页面,我在 URL 栏中看到只显示:https://localhost/,现在我点击 OK按钮登录,它应该做 Response.Redirect test.asp 在这种情况下它显示: https://localhost/test.asp

我为这个疯狂的长问题道歉,但我想在发布之前用尽所有选项。非常感谢任何帮助。

编辑:PER Daniel,我将错误设置配置为将错误发送到浏览器,这是我收到的内容:

Response object error 'ASP 0251 : 80004005'

Response Buffer Limit Exceeded

/Test.asp, line 0

Execution of the ASP page caused the Response Buffer to exceed its configured limit.

首先,从 IE 中删除 "friendly http error message",然后检查 "Send error to browser"。你会看到真正的错误信息。

ASP一般是缓冲整个页面,只有在缓冲中生成了整个页面后才输出。然而,缓冲区的大小是有限的——如果内存可用,大约为 4MB。看起来你这里有一个 真的 大页面,而且它在上面令人窒息。

所以你要做的就是边走边输出缓冲区。写 500 行,然后使用 Response.Flush

写出缓冲区

例如,假设我正在遍历大量记录并将它们输出到页面。我可以在每条记录上迭代 x,然后在循环结束时执行以下操作:

if x >= 500 then
    x = 0
    Response.Flush
end if