Application.Run not creating Main Form

  • Thread starter Thread starter rettigcd
  • Start date Start date
R

rettigcd

Sometimes my main form appears and sometimes it doesn't. VS.NET acts
as if the process is running and I can click the "stop" button but I
get no windows or forms.

Here is my code:

static void Main() {
try{
MainForm frm = new MainForm();
Application.Run( frm );
} catch( System.Exception ex ){
MessageBox.Show( ex.Message );
}
}

When I debug it, the MainForm constructs just fine but when the
execution enters Application.Run( ), the OnLoad event in never called
and the window doesn't appear.

Then I run it again and it works fine, and I run it again and it
doesn't.

Does anybody have any ideas about how I can figure out what the problem
is.

thanks,
Dean Rettig
 
Sometimes my main form appears and sometimes it doesn't. VS.NET acts
as if the process is running and I can click the "stop" button but I
get no windows or forms.

I very often had this problem with VS 2002 when running the application in
the Debug configuration. Seemed to me like a bug in VS. I've never had this
problem again since i upgraded to VS 2003.
 
Back
Top