Search code examples
c#error-handlingevent-log

What's the best way to debug a beta C# desktop application


I have a desktop windows 7 C# desktop application. It is about to become a beta for release and I was wondering what is the best way to log errors, or warnings when a user is using it.

I was thinking of using the EventLog. My main question is what the best way to do this? Should I use a lot of try/catches? I've read that this is time consuming and not efficient. I saw this tutorial http://tech.pro/tutorial/668/csharp-tutorial-dealing-with-unhandled-exceptions, but it seems to only catch unhandled exceptions according to the comments.

In the application I basically have a Web Browser and a lot of interactivity with javascript that passes the application Json and I do stuff, and if something goes wrong or if there is a warning I'd like to be able to go back and see what was going on at that time to cause it.


Solution

  • I would go with the Event Log approach. We had a program break on us at work and we wrote to the event log in a try/catch statement when our time clocks wouldn't catch new entries. It is always a decent place to start.