In Visual Studio 2005 Windows Applications there is always a class named
program that incorporates the following code:
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(fals e);
Application.Run(new StepByStep3_01());
}
I was trying to imitate this pattern using Visual Studio 2003. Recognizing
that not all the methods of .NET 2.0 may be available in .NET 1.1, I removed
the first two Application methods, and only tried using the Application.Run
method that I know exists in 1.1.
I made sure I had using statements for those namespaces that exist in 1.1
that correlate with those from the sampe in 2.0. I main the class program
in files program.cs the default startup, but when I attempted to compile,
the system had issues with the [STAThread] attribute. It did not
recognize it as an attribute and would not compile.
I am wondering what I missed, if anything. It seems to me that using a
program class with a main method is a good idea, but if I can't open a form
that way I will have go back to the standard method. Can anyone tell me
what I could be doing wrong?