[英]Why can't i see a detailed error message in this aspx page?
我有一个aspx页面 ,它显示自定义错误,但我看不到详细的错误消息。 我的web.config看起来像这样,
<?xml version="1.0"?>
<configuration>
<appSettings />
<connectionStrings />
<system.web>
<compilation debug="true" />
<authentication mode="Windows" />
<customErrors mode="On" />
</system.web>
</configuration>
要查看错误,您需要关闭 customErrors ,如下所示:
<customErrors mode="Off"></customErrors>
从文档中 ,以下是mode
属性的选项:
- 开 - 指定启用自定义错误。 如果未指定defaultRedirect属性,则用户会看到一般错误。 自定义错误显示给远程客户端和本地主机。
- 关 - 指定禁用自定义错误。 详细的ASP.NET错误将显示给远程客户端和本地主机。
- RemoteOnly - 指定仅向远程客户端显示自定义错误,并向本地主机显示ASP.NET错误。 这是默认值。
在实时生产站点上设置Off
是非常危险的,因为某些错误消息可能会危害您站点上的敏感数据(例如代码和路径甚至密码)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.