customErrors mode="off"

N

nicholas

Although in my web.config I have <customErrors mode="off" /> I still get no
detailed errors.
How comes ?

THX

This is what I get:


Server Error in '/mywebfolder'Application.
----------------------------------------------------------------------------
----

Runtime Error
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>
 
L

Leszek Taratuta

1. Are you using multiple web.config files? Check all of them.
2. What about machine.config?

Leszek Taratuta
 
N

nicholas

1) All web.config have customerrors = off
2) I'm not using a machine.config, what is this for?

THX for your reply !
Nic.
 
L

Leszek Taratuta

The machine.config file provides settings for the entire machine, not only
for a single Web Application.
It resides in the .NET directory. On my machine it is:
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\CONFIG
Try searching your hard-drive for machine.config.
This file contains <customErrors mode="RemoteOnly"/> by default.
Anyway this file (machine.config) is taken into account only when you do not
have web.config, so it is unlikely source of your problem.

Also check web.config that provides settings for your application. Maybe you
have multiple <customErrors> nodes. They might override their settings.

Leszek
 
J

Juan T. Llibre

Are you sure that the web.config is in a directory
marked as an Application or a Virtual Directory in IIS ?

If it is not, the web.config in the root directory,
or the settings in machine.config, will decide whether
custom errors will be displayed.

The default setting for custom errors in asp.net 1.1 is :
<customErrors mode="RemoteOnly" />

The possible settings are :

On : Always display custom errors

Off : Always display *ASP.NET* error pages
( Notice: this does *not* mean that no error messages
will be displayed. It means that ASP.NET error messages
will be displayed.

RemoteOnly : Display custom errors to remote
clients and ASP.NET errors to localhost

It could very well be ( in fact it probably is )
that you're seeing an ASP.NET error message,
and not a *custom* error page being displayed.

btw, in IE, do you have "Show friendly HTTP error messages"
selected in "Tools", "Internet Options", "Advanced" ?



Juan T. Llibre
ASP.NET MVP
===========
 
N

nicholas

- The website is hosted, so I cannot check for the machine.config.
- my web.config has just 1 customerror line

On my testing server I see the detailed error.

realy weird ....
 
N

nicholas

Hi,
Are you sure that the web.config is in a directory
marked as an Application or a Virtual Directory in IIS ?
As it is hosted, I can't see if they did it OK, unfortunately.
It could very well be ( in fact it probably is )
that you're seeing an ASP.NET error message,
and not a *custom* error page being displayed.
I know the error message, my hoster forwarded it to me.
It is a message that says that the sql-server cannot be found.
So there was a problem in my connection string.
That is solved. But I would like to understand why I couldn't see the error.
btw, in IE, do you have "Show friendly HTTP error messages"
selected in "Tools", "Internet Options", "Advanced" ?
No.
If I generate the same error on my testing server, I can see the error.

Conclusion: I think the problem situates itself at the hoster.
Must be some virtual directory thing.

Thx a lot!
Nic
 
G

Guest

It sounds like you are accessing the page remotely and not locally. Doing so
will also cause this to happen. I believe there is something along the lines
of remoteerrors in the web.config that you have to turn on.
 
S

Suhaib Khan

I'm not sure whether this problem is related to what I had, but still I'm
sharing it over here. On one of my production server my application was
throwing exception from Application_OnStart event but it was not getting
displayed in the browser window. In the end I had to capture this error in
Application_OnError event and that solved my problem.

This happened with .NET 1.1.
 
C

Chuck Green

I get that exact same error when I try to use MSN Messenger, how do I
fix it? Please e-mail me if you can help. Thanks.
 
G

Gema .

PLEASE, HELP ME!!
MY MSN MESSENGER PROGRAM HAS AN ERROR AND I DON´T KNOW HOW CAN I DO TO
REPAIR. PLEASE, SEND ME THE SOLUTION.

(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top