0

I keep getting this when I try hit the link of a website I just deployed to the web host's server:

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.

It Suggests I set the following in my web.config file so I can see details of the error:

The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's configuration tag to point to a custom error page URL.

So I have added the following to my webconfig file and created a mycustompage.htm relative to the web.config file:

<configuration>
<system.web>
    <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
</system.web>
</configuration>

My mycustompage.htm is empty, is there anything I should add in there? When I try hit the link now all I get is a blank page after the server tries to redirect to mycustompage.htm.

1
  • your mycustompage.htm will be empty unless you write code to catch errors and show, look at elmah and try to implement that to see errors - haacked.com/archive/2007/07/24/… Commented Mar 13, 2012 at 4:15

1 Answer 1

1

Depending on what you're trying to accomplish:

1) You want to view the actual error information.

In this case, remove the defaultRedirect attribute and change mode to Off. Custom errors intercept the standard Yellow Screen of Death (YSOD) ASP.NET error page. By setting Custom errors to Off, the YSOD error message will be visible to both local and remote clients (all remote users will see the error details).

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

2) You want to build a custom error page to handle how your application responds to error conditions.

In this case, you might edit the mycustompage.htm to display a friendly "An error has occurred" message rather than seeing the default Custom Errors are not enabled message.

Link here for reference.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.