Is there any way to catch all the excepions within an application at Main() with a single try-catch irrespective of threads and appdomains within the application??
In other words I just want to use one try-catch to log all the errors in my application instead of using multiple try catches in various places.
Would appreciate any ideas or code snippets…
Edit: I’m using a Console application and Windows Service.
Take a look at http://msdn.microsoft.com/en-us/library/system.appdomain.unhandledexception.aspx and http://msdn.microsoft.com/en-us/library/system.windows.forms.application.threadexception.aspx.
I think it fits you’re needs