我的Web.config确实包含了customErrors,即:
<system.web> <compilation debug="true" targetFramework="4.0"> <assemblies> ... </assemblies> </compilation> <customErrors mode="off"/> </system.web>
在这种情况下,我确切知道什么是潜在的错误. (我忘了在存储过程中设置权限)但是我真的想(重新)启用错误处理,所以我可以快速找到这些错误.当然,为了安全起见,一旦我们实际上上线了,我会删除它.
还有哪些其他设置可能会覆盖默认的ASP.NET错误处理?
解决方法
<customErrors mode="Off"/>
“关”必须正确大写.
从“Editing ASP.NET Configuration Files”:
Case-Sensitivity
Because tags must be well-formed XML,the tags,
subtags,and attributes are case-sensitive. Tag names and attribute
names are camel-cased,which means that the first character of a tag
name is lowercase and the first letter of any subsequent concatenated
word or words is uppercase. In most cases,string attribute values are
Pascal-case,which means that the first character is uppercase and the
first letter of any subsequent concatenated word or words is
uppercase. Exceptions are true and false,which are always lowercase.
记住孩子,你每天都会学到新的东西.即使你学到的是跛脚.