Debug .NET Production

I already have a Windows application for some time, and it is configured to send us error reports when it throws exceptions. Most of them are quite descriptive and help me quickly find the problem (I use the MS application exclusion block).

In several cases, I have reports that are issues that I cannot reproduce, and it seems to only happen on a few client machines.

I do not have physical access to these client machines, what strategies can I use for debugging? Would it be better to build some trace in the code, or are there any other alternatives?

Thanks.

Edit: I should have been more clear: the error messages I get have a stack trace, but since this is production code, it does not indicate the exact line that caused the exception, just the method in which it was thrown.

+6
debugging
source share
5 answers

One option is to generate a (mini-) dump file as close as possible to the point where the exception is thrown as possible. This article talks about how to do this from managed code.

Then you can load the dump file in Visual Studio or WinDbg and examine it using SOS

+2
source share

You are on the right track. You need to create a tracking module that locally logs actions / exceptions.

Then you can have a button or menu item that the user can click to automatically send you this information by e-mail when a problem occurs, or they may be able to receive the file so that it can transfer it to you in some other way.

You can even create a diagnostic code to run an integrity check on the system and send you a report (perhaps it runs all your unit tests to see if they work on that system).

+2
source share

I always use this module from Jeff for unhandled exceptions, sending me an email with stacktrace, etc.

+1
source share

Gurock Software's Smart Inspect came in handy many times for me. It is very easy to integrate into a .NET application and gives you extremely powerful control when analyzing log files. It has log levels that allow you to disable certain functions, except in some cases, so you do not lose performance.

They even have server software with which your software can connect to save logs when you do not have full access to the machines. For example, you might have a server running on www.yourdomain.com. Your software will have a configuration option to enable debugging. Smart Inspect will be configured to send log data to your server (and possibly to a local file) so that you can receive real-time logging no matter where the software is running.

Smart Inspect is very easy to set up and has many features that you can use. I use it to debug high-performance multi-threaded server applications on the fly without having to remove the machine. It has all the hooks to keep track of various processes, threads and machines.

+1
source share

I would use an event log. Look at here:

http://support.microsoft.com/kb/307024

0
source share

All Articles