When exiting my .NET CF 3.5 application on the Motorola MC3100 (CE 6.0 version only) I get the error message \"Application xxx has encountered a serious error and needs to shut
Application.Exit() is not recommended way to close applications. Close all opened forms in order to close application.
http://blogs.msdn.com/b/tom_krueger/archive/2005/02/24/379678.aspx
I had the same problem on a Motorola 9190-G using the .NET Compact Framework 3.5. At times I would have to warm boot the device because it would freeze after closing my application.
I was able to workaround the issue by specifying the font of the form the ListView
was contained in in the Constructor
to be Arial, 10pt, Regular. I then programmatically set the font to my desired font. For example, myListView.Font = new System.Drawing.Font("Tahoma", 11F, System.Drawing.FontStyle.Bold);
.
If I had the font set to any other font/font style/size combination, I would receive the "program encountered a serious problem and must shutdown" error message when closing the application on the mobile device.
We experienced this issue with Motorola MC3190 devices running Windows CE 6.0 / .NET 3.5 CF. For months we were encountering an intermittent fatal error dialog upon closing our application. Every possible option was explored from ThreadAbort exceptions to making sure every single resource was properly disposed.
Normally, if a device doesn't have a particular font or is trying to access one that happens to be unrecognized, it will default to Arial. With the MC3190 however, if a font isn't recognized, the device will display a fatal error dialog and freeze after exiting an application. This results in the user having to warm boot (sometimes cold boot).
We came up with two solutions to this problem:
I faced exactly the same problem. Tried the following (none solved the issue):
new Font()
statementsForm.Close()
instead of Application.Exit()
The only solution that finally worked for our case, (however it is not a "pretty" solution), has been the following command in the MainForm.Closed()
Process.GetCurrentProcess().Kill()
We encountered the same problem and solved with this line of code in the MainForm.Closed()
Process.GetCurrentProcess().Kill()
You should make a Form and run your code in Application.Run() context. At the end of Run, many resources are disposed "by magic". Otherwise you must dispose every resources that need to be disposed.