.net unexpectedly appears unexpectedly

I have a .NET 2.0 application that does not throw an exception or any other message when the application crashes. I am catching the Application.ThreadException event, and nothing happens on failure. After launching, the application disappeared for several days! There are no messages in the Windows event log, no dump file or anything else .... I tried to run the application on several computers, but after a few days the problem appears.

The application communicates with another PC via a TCP / IP connection, and all the data is valid all the time, not damaged connection or something else. Enough memory, also during a crash, etc. Disk space also does not cause problems. There is no way to upgrade to .NET 4.0.

The application is currently running under windbg, so I hope this gives some information.

If you have experience with this or you have helpful tips or tools, let me know!

+6
crash
source share
4 answers

If you use TCP / IP, you are most likely using streams. If the thread dies with an unhandled exception, very common when EndXxxx () is called, your application terminates. This can be quiet if Windows Error Reporting is disabled on the computer, which often happens on servers. At the very least, catch an ObjectDisposedException so that you can deal with a connection that suddenly disconnects or closes forcefully.

And yes, write an event handler for AppDomain.CurrentDomain.UnhandledException, subscribe to your Main () method. Record or show the value of e.ExceptionObject.ToString () so you can pinpoint what it is dying for.

+3
source share

When a .Net application crashes unexpectedly without any error warnings or unhandled exception handlers, it is very likely that your application encountered a stack overflow. This will lead to the rapid completion of the process in many cases without the use of any handlers.

+2
source share

Try AppDomain.UnhandledException . Application.ThreadException occurs only when an exception occurs in user interface threads.

+2
source share

I had this problem.

I wrote a .Net application that emulated keystrokes for other applications. I would leave him all night, hoping to find him, doing all my work by morning. He just disappeared. He wrote a journal every time he went in and out of the procedure so that I could see exactly what he had done. Nothing, no exception logs. Just work work. And then nothing.

It turns out that this is because I used a bunch of API calls, and I called them very often. This caused some memory leak, presumably in my application workspace.

<dirtyhack> As I decided, this was written by another .Net application (application 2), which launched a crash (application 1). After application 1 has terminated, but only the application of shell 2 before. Then application 2 launched application 1. </dirtyhack>

etc. etc. until all work has been completed! Anxiety and frustration, but ended up working pretty nicely :) I'm sure there is a much better way to do this. I probably did not collect my COM API calls correctly or anything else.

But it seems that closing the application and restarting it freed up memory (along with leaks) and allowed it to start again.

You may have nothing to use in your story, but this is my story. Amen.

+2
source share

All Articles