I have a windows service that is mysteriously dying on me at what appears to be random intervals. Sometimes its 3 hours, sometimes it's 2 days. Clearly an error is occuring but I haven't been able to pinpoint the problem
The service's OnStart method initializes an object whose constructor creates a thread that launches other threads based on certain DB criteria. Every method I call starts with a try and ends with a catch, and any errors are written to a Trace log file. Prior to the service dying, the Trace Log reports when threads error out, what happened, etc. When the service dies, however, no error messages appear in the trace log to suggest what could have killed it. The Windows Service executable is still "running" and when viewed in Task Manager still has a good deal of memory allocated but has fewer threads (8) than it has when healthy (9 or 10)
Does anyone have any suggestions on how to debug this? Maybe there's a tool out there that can help record when threads are added/deleted so that I can view the past 24 hours of data to see when my main thread died
I'm currently writing several mini-applications to see if I can pinpoint which piece of the framework or my code is causing these critical errors. However, a logging tool would REALLY make this easier
Jerry