iis-7 - IIS 7.5 经典 ASP 错误处理与 IIS 6 不同

标签 iis-7 asp-classic error-handling iis-6

我们正在将 ASP Classic/ASP.NET 应用程序从 IIS 6 迁移到 IIS 7.5。大多数事情在经典模式下运行得很好,但我们在 IIS 7.5 如何处理错误方面遇到了很多问题。我们使用经典的 ASP 页面进行错误报告,我们在此处捕获错误信息,然后重定向到一个页面以显示错误。基于我们的测试 Server.GetLastErrorRequest.ServerVariables("SCRIPT_NAME")从日志页面访问时,不返回错误详细信息和来源。是否有其他方法可以检索 IIS 7.5 上的错误信息或执行日志记录?

如果这有帮助,我们注意到 IIS 似乎生成了一个全新的请求,然后开始执行我们的错误捕获。

提前致谢。

最佳答案

@smaclell:见 http://dylanbeattie.blogspot.com/2008/12/fun-with-servergetlasterror-in-classic.html为您提供潜在的解决方案。

这是文章中的相关段落:

There was a very similar known bug in Vista which was supposedly fixed in SP1, but it looks like the same fix isn't part of Windows 2008 Server yet. There is a workaround, though - if you set the site's default error property (under IIS settings -> Error Pages -> Edit Feature Settings...) to the custom page, IIS will invoke this page whenever an error is not handled by an explicitly configured status-code handler (so your 404, etc. handlers will still work) - but for some reason, handling the error this way means Server.GetLastError() still works properly.

关于iis-7 - IIS 7.5 经典 ASP 错误处理与 IIS 6 不同,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4197844/

相关文章:

asp.net - 如何在 ASP.NET 中模拟 ASP Server.URLEncode?

php - 在 PHP 中获取异常上下文

visual-studio-2010 - 如何调试我在 IIS 7.5 上运行时使用 PreApplicationStartMethodAttribute 程序集属性设置的方法?

asp.net - IIS - 打开基本身份验证会导致登录重定向循环

vb6 - Visual Basic中的十六进制值

excel - 下载一个excel文件经典asp

部署在 IIS 7 上时,ASP.NET Web API 应用程序给出 404

asp.net-mvc - 第一个Web API session 请求非常慢

c++ - 使用插入方法时在C++中使用vector获取OUTOFRANGE错误

python-3.x - os.makedirs之后shutdownil.copy失败