I don't know if this can help you, but in a windows application you can add eventhandler to catch all thread exception.
Here is the tutorial where i get the information
This is the the trick :
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
static voidMain()
{
Application.ThreadException += new ThreadExceptionEventHandler(new ThreadExceptionHandler().ApplicationThreadException);
Application.Run(new Form1());
}
/// <summary>
/// Handles any thread exceptions
/// </summary>
public class ThreadExceptionHandler
{
public void ApplicationThreadException(object sender, ThreadExceptionEventArgs e)
{
MessageBox.Show(e.Exception.Message, “An exception occurred:”, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
But this show only the error messages... if you want some other debug information I think you have to write a Custom Log and write all sort of information befor and after the code you want to debug...