views:

41

answers:

2

I just want to see error insteas of asp.net showing me default error Server Error in '/' Application. What should i change in web config?

I used this,

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

Any suggestion i want to see errors in browser as i do live testing...

+1  A: 

Change this:

<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">

To this:

<customErrors mode="Off" defaultRedirect="GenericErrorPage.htm">

RemoteOnly means you'll see the errors if you're logged onto the web server itself (e.g. http://localhost/) Off means to display the errors to everyone, including remote clients.

Nick Craver
@Nick That didnt help me... I gave `customErrors mode="Off"` still same error
Jayam Ravi
Just change it to `<customErrors mode="Off">`
Greg
@Jayam - Sounds like you have a web.config syntax error, if it can't read the web.config, by default you won't be able to see it remotely. Are you sure the correct versions of .Net, etc are installed on the server?
Nick Craver
@Nick it was my connection string in the web.config
Jayam Ravi
A: 

An alternative is to browse to your site using it's localhost url. This will allow you to see the errors, but with the customErrors = "RemoteOnly", users browsing to the site using a non-localhost url will see the friendly error page. Also check the server's eventlog, if you're not confident that you are seeing the full error.

derek