Possible Duplicate:
Application.Exit
I have a Winforms app in which Application.Exit()
fails to run.
public Form1()
{
InitializeComponent();
path=parseINI();//Gets path from ini file
}
In my case, Application.Exit()
is being called from the parseINI method, where it doesn't work. Is the problem that its being called when the app is starting? I stuck it in another method that runs after the form is loaded, and it works there. I did use Environment.Exit in my parseINI method, and that worked (despite it being for console apps rather than WinForms).
EDIT: I should probably add that its there as a check, to make sure a file being read is formatted correctly, if it is, then its not called, otherwise the program exits.