gpt4 book ai didi

asp.net - 运行时错误

转载 作者:行者123 更新时间:2023-12-04 07:08:17 25 4
gpt4 key购买 nike

错误的含义是什么,我该怎么做才能解决这个问题? :

Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.



详细信息:要使此特定错误消息的详细信息可以在远程计算机上查看,请在位于当前 Web 应用程序根目录的“web.config”配置文件中创建一个标记。然后,此标记应将其“模式”属性设置为“关闭”。

最佳答案

它会在错误中告诉您:编辑 web.config 并将错误模式更改为关闭。

例如,添加以下内容:

<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>

出于安全原因,您不想在外部给出详细错误,因此这通常是一个更好的设置:
<configuration>
<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="~/Error.aspx"/>
</system.web>
</configuration>

如果从服务器访问,这将在您的开发机器或服务器上显示错误,但将外部用户重定向到自定义错误页面。

关于asp.net - 运行时错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/765796/

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