gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-02 09:22:44 27 4
gpt4 key购买 nike

我刚刚将 ASP.NET MVC 3 应用程序部署到我们的临时服务器。每当发生错误时,我无法获取详细的错误信息,即“蓝屏死机”。相反,我只是得到一个简单的“抱歉,处理您的请求时发生错误。”消息。

我的 Web.config 确实包括关闭自定义错误,即:

<system.web>
<compilation debug="true" targetFramework="4.0">
<assemblies>
...
</assemblies>
</compilation>
<customErrors mode="off"/>
</system.web>

在这种情况下,我确切地知道潜在的错误是什么。 (我忘记设置存储过程的权限。)但我真的想(重新)启用错误处理,以便我可以快速找到这些错误。当然,出于安全原因,一旦我们真正上线,我就会删除它。

还有哪些其他设置可以覆盖默认的 ASP.NET 错误处理?

最佳答案

<customErrors mode="Off"/>

“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.

记住 children ,你每天都会学到新东西。即使你学到的东西很蹩脚。

关于asp.net - 无法在 ASP.NET MVC 网站中获取详细的错误信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9065866/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com