tags:

views:

5317

answers:

14

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 looks 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 usefull info on it. What else can I do to turn customErrors OFF !?

A: 

I've had this problem before, unfortunately I cant remember how I sorted it.

However if you go to the control panel, then the event log, you can probably find whatever error is happening.

Hope that helps.

qui
+2  A: 

If you're still getting that page, it's likely that it's blowing up before getting past the Web.Confg

Make sure that ASP.Net has permissions it needs to things like the .Net Framework folders, the IIS Metabase, etc. Do you have any way of checking that ASP.Net is installed correctly and associated in IIS correctly?

Edit: After Greg's comment it occured to me I assumed that what you posted was your entire very minimal web.config, is there more to it? If so can you post the entire web.config?

Nick Craver
The few times I've run into this problem, it turned out to be an error in the web.config - definitely go over it w/ a fine-toothed comb first.
Greg Hurlman
Yes, exasperated I've overriden my web.config to this minimal settings. Still no joy
Radu094
The user on the application pool being used did not have read permissions to the directory my app was deployed to. Still can't figure out why I could not get an error to show that let me know that was the problem.
lambacck
Often this error can be found only in the system/security event log (until IIS 7), but having access to the event log easily in most cases is the trouble.
Nick Craver
A: 

Try restarting the application (creating an app_offline.htm than deleting it will do) and if you still get the same error message, make sure you've only declared customErrors once in the web.config, or anything like that. Errors in the web.config can have some weird impact on the application.

snomag
any time you modify the web.config the website gets restarted, no need to create an app_offline.htm!
Matt Frear
true, I've no idea why I suggested the app_offline to reset the app. :)
snomag
A: 

Do you have any special character like æøå in your web.config? If so make sure that the encoding is set to utf-8.

Frederik Vig
A: 

Is this web app set below any other apps in a website's directory tree? Check any parent web.config files for other settings, if any. Also, make your your directory is set as an application directory in IIS.

Greg Hurlman
A: 

If you're using the MVC preview 4, you could be experiencing this because you're using the HandleErrorAttribute. The behavior changed in 5 so that it doesn't handle exceptions if you turn off custom errors.

Will
+7  A: 

"Off" is case-sensitive.

Check if the "O" is in uppercase in your web.config file, I've suffered that a few times (as simple as it sounds)

Juan Manuel
bah after spending hours, I noticed I've done the same thing! Thanks a lot. I hate case-sensitive stuff...
dr. evil
I want the last 30 minutes of my life back. At least it was something silly instead of something serious.
DavGarcia
glad it helped you @dav :)
Juan Manuel
Although this was apparently not the issue for Radu094, I am sure it is the issue for very many out there that found this post as a search for their problem, so +1 to you!
awe
+1  A: 

You can generally find more information regarding the error in the Event Viewer, if you have access to it. Your provider may also have prevented custom errors from being displayed at all, by either overriding it in their machine.config, or setting the retail attribute to true (http://msdn.microsoft.com/en-us/library/ms228298(VS.80).aspx).

digitaljeebus
+7  A: 

Hi,

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:

<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.

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

A: 

You can also try bringing up the website in a browser on the server machine. I don't do a lot of ASP.NET development, but I remember the custom errors thing has a setting for only displaying full error text on the server, as a security measure.

Neil Barnwell
+1  A: 

I tried most of the stuff described here. I was using VWD and the default web.config file contained:

    customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm"
        error statusCode="403" redirect="NoAccess.htm" /
        error statusCode="404" redirect="FileNotFound.htm" /
    /customErrors

I changed mode="RemoteOnly" to mode="Off". Still no joy. I then used IIS manager, properties, ASP.Net Tab, Edit configuration, then chose the CustomeErrors tab. This still showed RemoteOnly. I changed this to Off and finally I could see the detailed error messages.

When I inspected the web.config I saw that there were two CustomErrors nodes in the system.web; and I have just noticed that the second entry (the one I was changing was inside a comment). So try not to use notepad to inspect web.config on a remote server.

However, if you use the IIS edit configuration stuff it will complain about errors in the web.config. Then you can rule out all of the answers that say "is there an XML syntax error in your web.config"

A: 

In the interests of adding more situations to this question (because this is where I looked because I was having the exact same problem), here's my answer:

In my case, I cut/pasted the text from the generic error saying in effect if you want to see what's wrong, put

<system.web>
   <customErrors mode="Off"/>
</system.web>

So this should have fixed it, but of course not! My problem was that there was a <system.web> node several lines above (before a compilation and authentication node), and a closing tag </system.web> a few lines below that. Once I corrected this, OK, problem solved. What I should have done is copy/pasted only this line:

<customErrors mode="Off"/>

This is from the annals of Stupid Things I Keep Doing Over and Over Again, in the chapter entitled "Copy and Paste Your Way to Destruction".

Cyberherbalist
A: 

Actually, what I figured out while hosting my web app is the the code you developed on your local Machine is of higher version than the hosting company offers you. If you have admin privileges you may be able to change the Microsoft ASP.NET version support under web hosting setting

Joseph D'Souza
A: 

We ran into a similar issue and it turns out that on Windows Server 2008, IIS7, .Net 3.5 it needs to be;

<customErrors mode="Off">

(no trailing slash)

Vegarari
Sorry to say this, but that will result in a bad config file. The node has to be closed. I bet you have a </customErrors> tag.
Chris Lively