Application Error Created in Compact Framework Application on Windows Ce 6.0

I get an application error message when I close the program using the cancel button and all that it does is close the form.

The error says: "appName.exe has encountered a serious error and needs to be disabled"

How can I fix it? This is no exception; no other information is provided. What could it be and how to fix it?

+4
source share
5 answers

That's what it was. My application has two forms: login and the main form, where all the action takes place. The login form has two buttons (Login and Cancel). The login button registers the user, closes the login form and opens the main form. The Cancel button simply closes the login form. To close the form, I just used this.Close ().

What happens is that I still have to explicitly manage the login form, doing something like:

frmLogin.Dispose(); frmLogin = null; 

before exiting the program (in my .cs program)

So that solved it. I had to make sure that this happens in both cases: when the user logs in, and also when they do not want to log in.

The important thing is that frmLogin is modal, so Dispose () is not called automatically when it closes.

+7
source

This is usually caused by an exception at the system level in the process space that managed code cannot catch. Typically, this happens when you P / Invoke go out on your own code and give it a bad pointer / parameter, and it throws an odd exception that is not defined by the CLR.

+1
source

Throw a try / catch block around the Application.Run (...) line in Program.cs, for example:

 try { Application.Run(new Form1()); } catch (Exception ex) { MessageBox.Show(ex.Message); } 

The message you see means there is an exception thrown that does not get there.

0
source

Take a look at some GUI components, DLLs, or port resources. For some time it is a closed port, for some time some component of the GUI (I deal with some component of the list GUI)

0
source

I had resharper installed and its cache was creating a problem. I deleted the cache and it worked.

0
source

All Articles