网站部署后出错。要求在Web配置中启用customErrors [英] Error after website deployment. Asks to enable customErrors in web config

查看:1124
本文介绍了网站部署后出错。要求在Web配置中启用customErrors的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么我在部署网站时出现此错误

错误,而我已将customerror标记设置为关闭

Why i m getting error in this line when deploying website
error while i already set customerror tag 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>

推荐答案

当您的应用程序中出现异常并且您有 CustomErrors 设置为

将自定义错误设置为开启无效。您需要设置 defaultRedirect 值,这是您的网站在发生错误时应重定向到的页面。通常您创建一个错误页面,比如Error.aspx并重定向到该页面。此页面有一条客户友好的消息。



如果你有异常登录。检查日志是否有问题。这就是你将如何纠正它并进一步移动。
This error comes when you have an exception in your application and you have CustomErrors set to On.
Just setting the custom error to On doesn't help. You will need to set a defaultRedirect value which is a page your website should redirect to when the error occurs. Usually you create an Error page, say Error.aspx and redirect to that page. This page has a customer friendly message.

If you have exception logging in place. Check the logs for what's wrong. That's how you will be able to correct it and move any further.


这篇关于网站部署后出错。要求在Web配置中启用customErrors的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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