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.
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.
I have used Trace class on MSDN for logging:
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 areDefaultTraceListener,TextWriterTraceListenerand theEventLogTraceListener. It allows you to specify levels (Warning,Error,Info) and categories.