Reputation: 83254
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
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
Reputation:
Can you check the Application Event Logs on the client's pc incase the .NET runtime is logging something?
Upvotes: 0
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
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