web.config中的customErrors mode =“Off”但在'/'应用程序中仍然是服务器错误

时间:2010-03-02 12:01:49

标签: asp.net deployment

我将asp.net网站部署到共享服务器.....

我收到了错误

Server Error in '/' Application.

运行时错误

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.

这是我的页面http://static3.nextgenits.com/Forms/Homepage.aspx

我缺少什么?......任何建议......

3 个答案:

答案 0 :(得分:0)

将其设置为debug="true",您将看到错误。或者如果可能的话,从本地机器浏览它。我还建议您使用类似elmah的内容来记录应用程序中的错误。然后,当您设置了自定义错误页面时,您将始终能够看到错误。

您收到消息的原因是因为您有一些其他错误,asp.net不希望在发布模式下显示,因为它可能包含您不希望最终用户看到的敏感信息。

答案 1 :(得分:0)

也许你的web.config中的拼写错误阻止了asp.net的eval。 customErrors部分。

修改 有点清楚。如果web.config中存在错误(它是XML文件),则ASP.NET无法解析该文件。这是一个错误。由于asp.net无法解析web.config,因此忽略了任何设置。

答案 2 :(得分:0)

您的应用程序的web.config未配置为远程显示错误消息。您必须编辑web.config并取消注释customErrors部分。还要确保将其设置为RemoteOnly。执行此操作后,您将在屏幕上看到实际错误,然后您可以相应地进行更正。以下是要使用的web.config部分:

<customErrors mode="RemoteOnly"/>