First, try to capture all unusual behavior just before the problem occurs. Log all step onto the system even log using
System.Diagnostics.EventLog
. Pay special attention for logging important events such as connection, current number of connections, creation of new thread (one of the fallacies is creating uncontrollable number of threads), etc.
Catch all exceptions in each thread and make a full dump of it, put to system event log. Follow my directions on threads and exception processing (many of them are related to UI, so ignore those):
How do i make a loop that will stop when a scrollbar reaches the bottom[
^],
When i run an application an exception is caught how to handle this?[
^].
Some sample code for using
EventLog
:
How to create event log under a folder[
^],
[EDIT]
MsBuild OutPut to the TextBox on the fly in Windows Application[
^] [END EDIT].
Collect results and try to fix the problem, ask more questions if you still don't know how.
—SA