Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 157461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T10:30:30+00:00 2026-05-11T10:30:30+00:00

If I have an application running on ASP.net and I have debug and stacktrace

  • 0

If I have an application running on ASP.net and I have debug and stacktrace enabled in web.config, I get a really nice Error Screen telling me exactly which code caused the error.

Sadly on a live system where debug is set to false, the yellow screen of death is quite unhelpful, even with stack trace enabled, it does not show the line where the error happened (which seems obvious since there should be no debug information).

I just wonder if there is a way to get a good information about an error without having to enable debug=true in the web.config file. It does not have to be an improvement on the Yellow Screen, I can also wrap the code that I suspect to offend in a try..catch block, but then inside the catch block, is there a way to get to the actual code that caused the error?

As you may suspect, this is for a situation where an error only occurs in production and no remote debugger is available 🙁

Edit: This is concerning ‘normal’ exception, like System.ArgumentOutOfRangeException. Littering the code with logging is something I would like to avoid if there is a better way just to get more information where the Exception actually occured.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T10:30:30+00:00Added an answer on May 11, 2026 at 10:30 am

    The first thing I’d do when faced with this would be to add a global exception handler to the global.asax, for example:

        protected void Application_Error(object sender, EventArgs e)     {         Exception ex = Server.GetLastError();         Log.WriteException(ex);   // this is your code     } 

    You can also do something like this on the page level, but I think you’re better off doing it at the application level. When you write out the exception to the log you can also write out more information to help you recreate the error, such as the request parameters or session information.

    Another good practice is add a section like this to your web.config:

      <customErrors mode='On' defaultRedirect='error.html'>     <error statusCode='500' redirect='500.aspx'/>     <error statusCode='404' redirect='404.aspx'/>     <error statusCode='403' redirect='403.aspx'/>   </customErrors>  

    This will show the error.html on all unknown errors, and show the appropriate pages you’ve defined for some specific errors where you can give the user more information as to how to resolve the error or help them find what they’re looking for.

    Error handling in asp.net is a pretty big topic, but this should be a good starting point.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 106k
  • Answers 106k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer They're the same thing, just scoped differently. NOLOCK is placed… May 11, 2026 at 8:58 pm
  • Editorial Team
    Editorial Team added an answer You might be better off using a TextInput with editable… May 11, 2026 at 8:58 pm
  • Editorial Team
    Editorial Team added an answer If you don't want to use conditional comments, then you… May 11, 2026 at 8:58 pm

Related Questions

We have an application that runs over load balanced server instances, and therefore is
This one is causing me a few nightmares as I'm on the live box
I have an asp.net mvc app running on a local iis website that is
I'm using ADO.NET EF in an MVC application. I'm considering putting the ObjectContext inside

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.