Graviton
Graviton

Reputation: 83254

.Net Application Exits Abruptly

My .Net appliaction exits abruptly on certain machines ( this is a desktop application). I tried to catch the exception but the catch statement I put on simply can't catch the exception that was happening.

Any ideas how to solve, or diagnose this problem?

Note: This exception only occurs at client's machine, release mode, on which we have no debugger tool to use.

Note 2: The application event log does not contain any errors at all.

Upvotes: 0

Views: 183

Answers (4)

Paul Alexander
Paul Alexander

Reputation: 32367

This is almost always caused by a COM/PInvoke issue where the native code you've used raises a Win32 exception. Under certain circumstances Windows will elect to simply abort the process rather than tear it down normally when their is major state corruption such as an invalid stack pointer.

If you can determine what specific behaviors precede the shutdown you can narrow your search for the controls/PInvokes that might be causing the problem.

Upvotes: 0

Jon
Jon

Reputation:

Can you check the Application Event Logs on the client's pc incase the .NET runtime is logging something?

Upvotes: 0

Joshua Belden
Joshua Belden

Reputation: 10503

In the debug drop down menu in Visual Studio choose exceptions and check all the checkboxes under thrown. This should halt the app at any unhandled exceptions. Examine it and give us the results.

Upvotes: 0

Kibbee
Kibbee

Reputation: 66122

You may want to try adding an event handler to System.Windows.Forms.Application.ThreadException and System.AppDomain.CurrentDomain.UnhandledException to see if you can figure out what exception (if any) is causing your application to terminate.

Upvotes: 2

Related Questions