Agile Noob
Agile Noob

Reputation: 11

Program will not run because of error code * Program does not contain a static 'Main' method suitable for an entry point

class CollegeStudent
{
    // fields
    private string studentName;
    private int midTerm1;
    private int midTerm2;
    private int finalExam;
    // properties
    public string StudentId
    {
        get { return studentName; }
        set { studentName = value; }
    }
    public int MidTerm1
    {
        get { return midTerm1; }
        set { midTerm1 = value; }

I don't know where to enter the entry point and Im pretty much stuck. I have read another post, but it is not very clear on how they solved it and when I try to apply what they did to my own it does not work. If anyone can help with this it be great. The code itself reads * program does not contain a static 'Main' method suitable for an entry point

Upvotes: 0

Views: 52

Answers (1)

Eng Hazymeh
Eng Hazymeh

Reputation: 147

Your project type is console that required main static method it is called (driver method) it is mandatory to run console application .

static void Main(string[] args)  
{  
//...  
}

If you want to make DLL , you should use Class Library Project type add class library in visual studio 2017.

Upvotes: 1

Related Questions