asp.net - 运行时错误

标签 asp.net

错误的含义是什么,我该如何解决这个问题? :

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”配置文件中创建一个标记。然后,该标签的“mode”属性应设置为“Off”。

最佳答案

它在错误中告诉您:编辑 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/

相关文章:

asp.net - 从 HttpRequest 获取状态码

asp.net - 将自动Web测试集成到构建过程中

javascript - VB.NET - 注册启动脚本然后重定向到同一页面

c# - asp.net如何反序列化json

c# - 序列化类型错误的对象时检测到循环引用?

c# - 为什么邮件主题在 MailGun 的 HTTP 帖子中重复?

asp.net - 对 Azure 媒体服务中的 2 个作业任务使用相同的输出 Assets

asp.net - ASP.net session 状态服务信息

c# - 处理/清理网络服务代理

c# - anchor 标签的 OnClick 事件