Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
447 views
in Technique[技术] by (71.8m points)

asp.net - CustomErrors mode="Off"

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.

Exasperated, I've set my web.config to look like this:

<?xml version="1.0"?>
<configuration>
    <system.web>
        <customErrors mode="Off"/>
    </system.web>
</configuration>

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 ?!

Question&Answers:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

This has been driving me insane for the past few days and couldn't get around it but have finally figured it out:

In my machine.config file I had an entry under <system.web>:

<deployment retail="true" />

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.

The machine.config is located at

32-bit

%windir%Microsoft.NETFramework[version]configmachine.config

64-bit

%windir%Microsoft.NETFramework64[version]configmachine.config 

Hope that helps someone out there and saves a few hours of hair-pulling.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...