How to debug a fatal error that occurs after a .Exit () application is called in a .NET CF 3.5 WinForms application for Windows CE 6?

I am migrating the .NET CF 1.0 WinForms application (for older versions of Windows CE) to .NET CF 3.5 (for Windows CE 6). The problem is that a few seconds after calling Application.Exit (), I get a "fatal error" error message that just says something about the effect "A fatal error has occurred and the application will terminate.". Since I'm using the Chinese version of Windows CE, the message is in Chinese, and I'm not sure the exact message is in English. In any case, the error message automatically disappears, and the application cannot completely shut down and free up resources, so the entire operating system becomes unusable (launching any application will lead to perpetual hourglass animation, docking the device in its stand also does not cause ActiveSync to connect) until I can boot the device.

This fatal error apparently never occurred in its original form (.NET CF 1.0) on an older device.

And since this is not a .NET exception, it does not fall into the .NET runtime.

What can I do?

+3
source share
3 answers

Since you cannot catch the exception that occurs in Application.Exit() , it sounds like you are facing an error that I saw before. Try commenting out all the lines where you set the Font attribute. If the application exists without an error message, you encounter an error that affects only NetCF 3.5 only on WinCE 6.0. See this link for more details.

+2
source

It seems that Dispose or Finalizer has a problem that occurs when the GC cleans the house. Check out all application finalizers and all Dispose overrides. If this cannot be found, look at all the workflow stops (things sitting in blocking calls, reading descriptors that might be invalid, etc.).

+2
source

I recently ran into this problem and the problem was that the forms were not deleted. So what I had to do on each form load, I added an instance of the form to the global list, which contained all open forms, and when I exit the program, I scroll through the list and do form.dispose on each. It solved my problem instantly.

0
source

Source: https://habr.com/ru/post/1478964/


All Articles