如何解决此自定义错误 [英] how to resolve this custom error

查看:94
本文介绍了如何解决此自定义错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

描述:服务器上发生了应用程序错误。此应用程序的当前自定义错误设置可防止远程查看应用程序错误的详细信息(出于安全原因)。但是,可以通过在本地服务器计算机上运行的浏览器查看它。



详细信息:
启用此特定错误消息的详细信息要在远程计算机上查看,请创建一个< customErrors>位于当前Web应用程序根目录中的web.config配置文件中的标记。这个< customErrors>然后,tag应将其mode属性设置为Off。

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 "web.config" 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>





我试过这个但是没用?







I have tried this but no use???


Changing customErrors tag to: <customErrors mode="On" />
Changing customErrors tag to: <customErrors mode="Off" />
Changing compilation tag to: <compilation debug="false" defaultLanguage="c#">

推荐答案





当您的应用程序和浏览器中出现一些错误时,会出现此错误,因为它只是因为你没有在你的web.config文件中提到自定义错误标记。



您考虑3个选项:



1.在本地运行您的应用程序,检查t他发错了,然后再次主持。

2.在Web配置文件中关闭自定义错误标签

3.检查.net框架的版本,即你有哪个开发了应用程序,并尝试使用哪个框架来承载此应用程序。



希望它能帮到你。
Hi,

This error comes when some bugs are in your application and on the browser it ll not show you just becasue of you did''t mention custom error tag in to your web.config file.

You have 3 options as i consider :

1. run your application on local,check the bug and then again host that.
2. make custom error tag off in web config file
3. check with the version of .net framework i.e on which you have developed the application and with which framework you are trying to host this applicaiton.

hope it ll help you.


嗨! !在这样的代码中进行更改:



hi !!!! make change in your code like this:

<!--
        The <customErrors> section enables configuration
        of what to do if/when an unhandled error occurs
        during the execution of a request. Specifically,
        it enables developers to configure html error pages
        to be displayed in place of a error stack trace.

    <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
        <error statusCode="403" redirect="NoAccess.htm" />
        <error statusCode="404" redirect="FileNotFound.htm" />
    </customErrors>
    -->





对其发表评论



make comment on it


这篇关于如何解决此自定义错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆