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 6653529
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:16:51+00:00 2026-05-26T01:16:51+00:00

If I write this: class Program { static void Main(string[] args) { throw new

  • 0

If I write this:

class Program
{
    static void Main(string[] args)
    {
        throw new Exception("lol");
    }
}

and run the exe from the command line, I get two entries in my event log. One is an application error that says there was an unhandled exception, and the other contains the stack trace with the source as .NET Runtime.

If I write this:

class Program
{
    static void Main(string[] args)
    {
        Recurse4Evr();
    }

    static void Recurse4Evr()
    {
        Recurse4Evr();
    }
}

I only get one entry in my event log, which says Application Error and that there was a stack overflow exception. There isn’t that second entry with the stack trace, so it’s basically useless.

Why isn’t the stack trace also logged? If I setup DebugDiag and attach it to my process and then there is a stack overflow, DebugDiag is able to log the stack trace. Obviously the stack trace is available to the outside world in some way. If the runtime is terminating the process because it detected a stackoverflow, then it also knows what the stack is.

In large applications that have many complex interactions, it is often not possible to recreate the conditions that led to a stack overflow. In this situation, a stack trace is the only way to figure out what happened. Why did microsoft decide it wasn’t important to log this information? Was there a legitimate design decision that isn’t obvious?

  • 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. Editorial Team
    Editorial Team
    2026-05-26T01:16:52+00:00Added an answer on May 26, 2026 at 1:16 am

    This is apparently not possible. If you want a stack trace so you can find the offending code that killed your application, you need to attach a 3rd party tool like DebugDiag or AdsPlus. Good luck, there is basically no documentation for these tools.

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

Sidebar

Related Questions

class Program { static void Main(string[] args) { string value = "12345"; Type enumType
I could write myself a helper class that does this when given a functor,
I'd like to write a MessageConverter class that can wrap another MessageConverter. This MessageConverter
When I write code like this in VS 2008: .h struct Patterns { string
I am new to programming and Java and trying to write a program which
My class assignment is to write a program that has the user input a
If I run this simple program on Windows 7 and then on AIX (Unix
I once wrote this line in a Java class. This compiled fine in Eclipse
I could probably write this myself, but the specific way I'm trying to accomplish
I would like to write this as a user defined function: private double Score(Story

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.