自定义错误模式 =“关闭" [英] CustomErrors mode="Off"
问题描述
每次我将我的 web 应用程序上传到提供程序时,我都会收到错误消息.由于 customErrors 模式,我看到的只是默认的运行时错误"消息,指示我关闭 customErrors 以查看有关错误的更多信息.
I get an error everytime I upload my webapp to the provider. Because of the customErrors mode, all I see is the default "Runtime error" message, instructing me to turn off customErrors to view more about the error.
被激怒了,我把我的 web.config 设置成这样:
Exasperated, I've set my web.config to look like this:
<?xml version="1.0"?>
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>
而且,我得到的只是愚蠢的远程错误页面,上面没有任何有用的信息.我还能做些什么来关闭 customErrors ?!
And still, all I get is the stupid remote errors page with no useful info on it. What else can I do to turn customErrors OFF ?!
推荐答案
这几天来一直让我发疯,无法绕过它,但终于弄清楚了:
This has been driving me insane for the past few days and couldn't get around it but have finally figured it out:
在我的 machine.config 文件中,我在
下有一个条目:
In my machine.config file I had an entry under <system.web>
:
<deployment retail="true" />
这似乎覆盖了您在 web.config 文件中指定的任何其他 customError 设置,因此将上述条目设置为:
This seems to override any other customError settings that you have specified in a web.config file, so setting the above entry to:
<deployment retail="false" />
现在意味着我可以再次看到我需要的详细错误消息.
now means that I can once again see the detailed error messages that I need to.
machine.config
位于
32 位
%windir%Microsoft.NETFramework[version]configmachine.config
64 位
%windir%Microsoft.NETFramework64[version]configmachine.config
希望能帮助到那里的人并节省几个小时的拉头发时间.
Hope that helps someone out there and saves a few hours of hair-pulling.
这篇关于自定义错误模式 =“关闭"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!