This question is slightly related to this exception handling question . The workaround I found there is to flip my own message loop.
So, my main method now looks basically like this:
[STAThread]
static void Main() {
Application.SetUnhandledExceptionMode(UnhandledExceptionMode.ThrowException);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Form form = new MainForm();
form.Show();
do {
try {
Application.DoEvents();
Thread.Sleep(100);
}
catch (Exception ex) {
ExceptionHandler.ConsumeException(ex);
}
}
while (!form.IsDisposed);
}
What interests me is a safe / decent way to replace the more typical 'Application.Run (new MainForm ()); whether it is used to handle exceptions or for anything else, or should I always stick with Application.Run?
, (splashscreen), , , - (: -))