I am currently working on a c# linux application being run under mono. Although, I believe I’ve handled any possible exceptions that might be thrown within my program, but should I have missed any, I was wondering if there is a way that when the C# application crashes it creates a core dump file so I can see the exception and go through it to try and determine what caused the problem like GDB does for C programs.
I’m using OpenSuse 12.1 for my application.
Thanks for any help you can provide.
Yes, you can, but you can only find out what
.NET exceptionhappened, dunno if you can do a core dump without third-party softwere though.Depending on the type of the application you can hook one of the following
events:if you use
Windows Forms Applicationyou could subscribe toSystem.Windows.Forms.Application.ThreadExceptionif you use
WPFyou could subscribe toSystem.Windows.Threading.Dispatcher UnhandledExceptionif you want to subscribe to a general
UnhandledExceptionevent, you could subscribe toSystem.AppDomain.UnhandledException(but I guess if the application don’t have enough access can’t access this event).