I am using visual studios and I keep getting the same error.

Error 1 Program 'c:\Users\M\Desktop\C#\Parameter\Parameter\obj\Debug\Parameter.exe' does not contain a static 'Main' method suitable for an entry point C:\Users\M\Desktop\C#\Parameter\Parameter\CSC

How do you properly do a method in visual studios, it seems that I can't do it properly.

Recommended Answers

All 6 Replies

So technically, my method is right but not the project's properties?

Depends. Do you have a static Main method in your code? We can't see what you've done from here.

I did, and then I removed it and still had the same error.

the problem might be

    /// The main entry point for the application.
    /// </summary>
    [STAThread]
    static void Main()

missing

There might be no main method in your Class.You have declared classes but none of them have Main() class

Main()

Main is your program's start point. Without that the program has no idea what to do first. Even if yopu want a certain routine to run first you have to call it from Main. Main is also where any parameters being passed are sent to. If you've been deleting things willy-nilly then you might be better off to copy your code and paste it into a new project, with the code for Main already started for you. Beyond that it's hard to say how to fix it when you haven't shared any code that's broken.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.