Application has encountered a problem and needs to close
I need to find where the application is running into an unhandled exception. I am supporting this from a previous developer. The application is running and the users aren't interacting with it at the time it crashes. I have ran it i开发者_运维问答n debug mode and it doesn't crash. I know the project in the solution where it happens, but that code is like almost 10,000 lines. Any help would be appreciated.
Add subscription to the AppDomain.UnhandledException event as early as you can:
AppDomain.CurrentDomain.UnhandledException += YourHandler
Inside you can log the exception information and anlyze it later
You aren't giving much to go on. You might want to look up AppDomain.UnhandledException
System.AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
There isnt much info given in the post above. I found following article alot more better: http://www.switchonthecode.com/tutorials/csharp-tutorial-dealing-with-unhandled-exceptions
精彩评论