看到一般的 500 内部错误,如何查看详细错误?
在我的生产服务器上,我刚刚部署了一个 ASP.NET Web 应用程序。
我看到一般的“500 内部服务器错误”。
在解决问题之前如何暂时查看详细错误?
我已经有:
<customErrors mode="Off" defaultRedirect="error.aspx"/>
On my production server, I just deployed a asp.net web application.
I am seeing a generic '500 internal server error'.
How can I view a detailed error temporarily until I fix the problem?
I already have:
<customErrors mode="Off" defaultRedirect="error.aspx"/>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
通常就足够了。但是,如果您搞乱了某些 IIS 配置,它甚至无法到达您的 web.config,这可能可以解释为什么您会看到此通用 500 错误消息。查看服务器的事件日志 (eventvwr.msc
),其中可能包含有关错误的其他信息。确实可能有很多可能的原因(.NET 框架配置错误、应用程序池或虚拟目录配置错误、缺少某些文件夹的访问权限……)这就是为什么您应该拥有一个与生产环境具有相同配置的临时服务器的原因服务器 - 它允许您在发货前测试您的配置。
<customErrors mode="Off" />
is usually enough. But if you have messed up with some IIS configuration it won't even reach your web.config which might explain why you are seeing this generic 500 error message. Take a look at the Event Log (eventvwr.msc
) of the server which might contain additional information about the error. There could really be lots of possible reasons (.NET framework misconfiguration, application pool or virtual directory misconfiguration, missing access rights to some folders, ...)That's the reason why you should have a staging server which has the same configuration as your production server - it would allow you to test your configuration before shipping.
将 IIS 错误页面功能设置更改为“详细错误”或尝试从部署该应用程序的服务器运行该应用程序。
Change IIS Error Pages feature settings to "Detailed errors" or try to run the app from the server where it's deployed.
如果由于某些配置不正确而导致错误页面来自 IIS,您可以尝试使用 失败的请求跟踪。
If the error page is coming from IIS because of some configuration being incorrect, you can try using Failed Request Tracing.