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

  • SEARCH
  • Home
  • 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 8693401
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:32:14+00:00 2026-06-13T00:32:14+00:00

I have C# application. I can compile it in debug mode, with any flags

  • 0

I have C# application. I can compile it in debug mode, with any flags etc. if required.

After some point it doesn’t function properly (significant slow-down, partly hangs etc. etc.)

Obviously something goes wrong. As a first try I want to see complete list of all exceptions that hapened anywhere during program execution (caught and uncaught). Is it possible? I know there is an option in VS that allows me to “brekpoint” at certain exception. But I don’t want to “breakpoint”, instead I want to “log” all happened exceptions so I can analyze them later.

  • 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-06-13T00:32:15+00:00Added an answer on June 13, 2026 at 12:32 am

    Try to use UnhandledException in you application if you are not sure where exceptions can occur possibly.

    The UnhandledException event handles uncaught exceptions thrown from the main UI thread. The ThreadException event handles uncaught exceptions thrown from non-UI threads.

    static void Main(string[] args)
    {      
        AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
        //... do something ...      
    }
    
    static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
    {
          System.Diagnostics.Trace.WriteLine((e.ExceptionObject as Exception).Message, "Unhandled UI Exception");
          // here you can log the exception ...
    }
    

    I have used Trace class on MSDN for logging:

    System.Diagnostics.Trace
    

    This includes listeners that listen for your Trace() methods, and then write to a log file/output window/event log, ones in the framework that are included are DefaultTraceListener, TextWriterTraceListener and the EventLogTraceListener. It allows you to specify levels (Warning,Error,Info) and categories.

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

Sidebar

Related Questions

I have a C++ application that works and compile perfectly. I can execute and
I have an application that can be viewed with landscape and portrait mode. I'm
I have some code but it wan't compile. I can't go further with this
I have an application that can filter a datagridview based on date using a
I have an application that can potentially have hundreds of memory mapped, i.e., mmap()
In C++, a console application can have a message handler in its WinMain procedure,
I have an application where users can store items. Now each type of account
I have an application where I can launch a modal dialog box over a
I have an application where I can have an image moving towards the eye.
I have a web application that can load plugins through reflection. It currently uses

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.