does not contain a static 'Main' method suitable for an entry point

Posted on 2011-05-05
Last Modified: 2012-05-11
Hi All,

I left visual studio on over night and a project that was building is no longer working.  I get the following error:

"Program 'C:\<PATH>\PhoneApplication\obj\Debug\PhoneApplication.exe' does not contain a static 'Main' method suitable for an entry point"

Here is the begining of my form1.cs file:

using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Data.SqlClient;
using System.Data.Sql;

namespace PhoneApplication
    public partial class Form1 : Form

        #region Set Variables

        //OM Commands
        public string strChdnrc = "";
        public string strChtrfc = "";
        public string strCalf0 = "";
        public string strCalf1 = "";
        public string strAllComm = "";

        //Input variables
        public string strFirstname = "";
        public string strSurname = "";
        public string strFloorPort = "";

Open in new window

Does anyone know how this might be fixed?

Question by:ImaCircularSaw
    LVL 6

    Accepted Solution

    The Main method should be in the Program.cs file. Can you give us that file?
    LVL 9

    Expert Comment

    Are the properties on the file set to Compile ?
    LVL 9

    Expert Comment

    LVL 10

    Author Comment

    The program.cs file had been removed from the project.


    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
    Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
    This video discusses moving either the default database or any database to a new volume.
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now