关于ASP.NET 服务器报错 Server Error in ‘/‘ Application Runtime Error 错误及解决方法

阅读: 评论:0

关于ASP.NET 服务器报错 Server Error in ‘/‘ Application Runtime Error 错误及解决方法

关于ASP.NET 服务器报错 Server Error in ‘/‘ Application Runtime Error 错误及解决方法

报错

Runtime Error 

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.

Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a &#fig" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".
 

<!-- Web.Config Configuration File --> <configuration> <system.web> <customErrors mode="Off"/> </system.web> </configuration>


Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.
 

<!-- Web.Config Configuration File --> <configuration> <system.web> <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/> </system.web> </configuration>

 

这是因为配置文件隐藏了错误信息  首先应该在system.web节点下 加上

 <customErrors mode="Off" defaultRedirect="error/error.html">
      <error statusCode="403" redirect="error/error.htm" />
      <error statusCode="404" redirect="error/error.htm" />
    </customErrors> 

 这个表示 显示错误信息 然后展示错误页面

然后去掉这个节点的代码 <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>

这个节点表示 即使运行时报错 我也不给你看 就给你展示上图贴的代码 只有在本地Localhost 才会显示错误

参考

 

 

本文发布于:2024-02-04 06:04:21,感谢您对本站的认可!

本文链接:https://www.4u4v.net/it/170700621152925.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:报错   解决方法   错误   服务器   NET
留言与评论(共有 0 条评论)
   
验证码:

Copyright ©2019-2022 Comsenz Inc.Powered by ©

网站地图1 网站地图2 网站地图3 网站地图4 网站地图5 网站地图6 网站地图7 网站地图8 网站地图9 网站地图10 网站地图11 网站地图12 网站地图13 网站地图14 网站地图15 网站地图16 网站地图17 网站地图18 网站地图19 网站地图20 网站地图21 网站地图22/a> 网站地图23