How to really turn off Errors?

Discussion in 'ASP.NET / ASP.NET Core' started by imcrainjames, Jun 20, 2010.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. I realize this is perhaps a simple question, but it has me stumped.

    I am trying to prevent users from seeing detailed error messages, and while I have compilation debug=false in my web.config, I am still seeing error messages like the one I have attached.

    Does anyone have any suggestions?

    Thanks so much in advance.

    James
     

    Attached Files:

  2. Thanks for your help. I have actually implemented a Global.asax file, and used the Application_Error method (see attached).

    Is it possible I still need to do something else?
     

    Attached Files:

  3. With your code as it is, the call to Server.ClearError() will never get processed because you have a call to Server.Transfer(""); first. The MSDN documentation for Server.Transfer advises:

    "For the current request, terminates execution of the current page and starts execution of a new page by using the specified URL path of the page.".

    I expect what you're seeing is an attempt to transfer to some error page however because ClearError never gets called, the default ASP.NET error page still gets displayed.

    The second link I included in my 1st post explains the options in detail and it does include a global.asax example. In addition to a custom error page you might also want to investigate configuring health monitoring in the web.config for email notification of exceptions as they occur.
     
  4. Excellent! Thanks so much, I will give it a try.
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page