raksmart活动促销

分享

写回答

发帖

翻译一下 谢谢 【实在是看不懂】(已解決問題)

 关闭

英文翻译专版 英文翻译专版 2584 人阅读 | 1 人回复

发表于 2010-12-23 19:47:03 | 显示全部楼层 |阅读模式

Thank you for contacting Online Support.

By default, our Windows hosting servers display a generic error when any .NET application generates an exception. We display a generic error because the detailed error messages allow a malicious user to obtain sensitive information.



To troubleshoot the error, you can modify your web.config file and specify that a custom error message displays. A custom error message helps you to locate the specific code that is causing the issue.



CAUTION: The code samples we provide below do not constitute a complete web.config file. Do not replace your existing web.config file with the code we provide. Before changing your web.config file, we recommend creating a backup.





Displaying Custom Error Messages / Enabling Detailed Errors on IIS 6




Use the sample code below to display custom error messages on IIS 6:




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





Displaying Custom Error Messages / Enabling Detailed Errors on IIS 7




Use the sample code below to display custom error messages on IIS 7:



<configuration>
    <system.webServer>
        <httpErrors errorMode="Detailed" />
        <asp scriptErrorSentToBrowser="true"/>
    </system.webServer>
    <system.web>
        <customErrors mode="Off"/>
        <compilation debug="true"/>
    </system.web>
</configuration>








Please let us know if we can assist you in any other way.

回答|共 1 个

kingto

发表于 2010-12-23 20:20:22 | 显示全部楼层

默认情况下,我们的windows服务器会在.NET应用程序产生意外时显示错误。
我们只显示泛指的错误旨在防止具体而敏感的信息被恶意人士获得。

对于找到具体错误,您可以修改您的web.config 文件,具体自定义一个错误消息显示。自定的错误消息可以帮助您为问题所在定位,方便您找到错误根源。

注意:以下我们提供给您的代码样本并不是web.config 文件的全部,只是他的一部分,请勿把它覆盖您的web.config 文件!编辑web.config文件前,推荐您备份一下。

IIS6下:
<configuration>
    <system.web>
        <customErrors mode="Off"/>
        <compilation debug="true"/>
    </system.web>
</configuration>

IIS7下:
<configuration>
    <system.webServer>
        <httpErrors errorMode="Detailed" />
        <asp scriptErrorSentToBrowser="true"/>
    </system.webServer>
    <system.web>
        <customErrors mode="Off"/>
        <compilation debug="true"/>
    </system.web>
</configuration>
您需要登录后才可以回帖 登录 | 注册

本版积分规则