加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

在ASP.NET MVC网站中无法获取详细的错误信息

发布时间:2020-12-15 23:23:53 所属栏目:asp.Net 来源:网络整理
导读:我刚刚部署了一个ASP.NET MVC 3应用程序到我们的分段服务器.无论何时发生错误,我无法获取详细的错误信息,即“黄色屏幕死亡”.相反,我只是得到一个简单的“对不起,在处理您的请求时出错.”信息. 我的Web.config确实包含了customErrors,即: system.web compil
我刚刚部署了一个ASP.NET MVC 3应用程序到我们的分段服务器.无论何时发生错误,我无法获取详细的错误信息,即“黄色屏幕死亡”.相反,我只是得到一个简单的“对不起,在处理您的请求时出错.”信息.

我的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.

记住孩子,你每天都会学到新的东西.即使你学到的是跛脚.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读