I’m a beginner to Visual Studio, I can create Windows From Projects and Console Projects just fine, but I can’t compile Empty Projects,
The steps I take are:
- Create an Empty Project.
- Add a class, add a reference to System and System.Windows.Forms
-
Put the following code in the class:
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows.Forms; namespace Circles { class Program { static void Main(string[] args) { MessageBox.Show("Hello World!"); } } }
Then I hit compile, and it gives me this error:
Error 1 Program ‘D:\C #\Projects\Circles\Circles\obj\x86\Debug\Circles.exe’ does not contain a static ‘Main’ method suitable for an entry point Circles
The Properties build action is set to compile, but the Startup Object in the Project roperties is not set, is this causing the problem, if so what can I do?
EDIT: Question resolved see CharithJ’s answer below.
Thanks Guys.
mainmethod name should beMain