Click here to Skip to main content
15,884,176 members
Home / Discussions / C#
   

C#

 
AnswerRe: 18 Errors Needs to be Fixed Pin
Richard Deeming30-Jan-23 21:49
mveRichard Deeming30-Jan-23 21:49 
GeneralRe: 18 Errors Needs to be Fixed Pin
Michael Afolayan30-Jan-23 22:58
Michael Afolayan30-Jan-23 22:58 
GeneralRe: 18 Errors Needs to be Fixed Pin
Richard Deeming30-Jan-23 23:09
mveRichard Deeming30-Jan-23 23:09 
GeneralRe: 18 Errors Needs to be Fixed Pin
Richard MacCutchan30-Jan-23 23:11
mveRichard MacCutchan30-Jan-23 23:11 
GeneralRe: 18 Errors Needs to be Fixed Pin
Michael Afolayan30-Jan-23 23:23
Michael Afolayan30-Jan-23 23:23 
GeneralRe: 18 Errors Needs to be Fixed Pin
Richard MacCutchan30-Jan-23 23:09
mveRichard MacCutchan30-Jan-23 23:09 
GeneralRe: 18 Errors Needs to be Fixed Pin
Calin Negru1-Feb-23 1:00
Calin Negru1-Feb-23 1:00 
AnswerRe: 18 Errors Needs to be Fixed Pin
OriginalGriff30-Jan-23 22:09
mveOriginalGriff30-Jan-23 22:09 
Read the error messages carefully - they are there to help you!
Error
Public Main() method is required in a public class

Your class isn't public and your Main method isn't public
So change that:
C#
public class Program
{
    public static void Main(string[] args)
    {

How hard was that to work out?

You should expect to get syntax errors every day, probably many times a day while you are coding - we all do regardless of how much experience we have! Sometimes, we misspell a variable, or a keyword; sometimes we forget to close a string or a code block. Sometimes the cat walks over your keyboard and types something really weird. Sometimes we just forget how many parameters a method call needs.

We all make mistakes.

And because we all do it, we all have to fix syntax errors - and it's a lot quicker to learn how and fix them yourself than to wait for someone else to fix them for you! So invest a little time in learning how to read error messages, and how to interpret your code as written in the light of what the compiler is telling you is wrong - it really is trying to be helpful!

So read this: How to Write Code to Solve a Problem, A Beginner's Guide Part 2: Syntax Errors[^] - it should help you next time you get a compilation error!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!

GeneralRe: 18 Errors Needs to be Fixed Pin
Michael Afolayan30-Jan-23 23:15
Michael Afolayan30-Jan-23 23:15 
GeneralRe: 18 Errors Needs to be Fixed Pin
OriginalGriff31-Jan-23 2:06
mveOriginalGriff31-Jan-23 2:06 
GeneralRe: 18 Errors Needs to be Fixed Pin
CHill601-Feb-23 3:58
mveCHill601-Feb-23 3:58 
QuestionWhat's up with displaying transparent pixel? Closed Pin
mo149229-Jan-23 0:13
mo149229-Jan-23 0:13 
AnswerRe: What's up with displaying transparent pixel? Closed Pin
lmoelleb30-Jan-23 1:52
lmoelleb30-Jan-23 1:52 
QuestionWhy is my AlphaPanel approach to disable the entire GUI so slow? Pin
arnold_w25-Jan-23 4:45
arnold_w25-Jan-23 4:45 
AnswerRe: Why is my AlphaPanel approach to disable the entire GUI so slow? Pin
Gerry Schmitz25-Jan-23 6:09
mveGerry Schmitz25-Jan-23 6:09 
GeneralRe: Why is my AlphaPanel approach to disable the entire GUI so slow? Pin
arnold_w27-Jan-23 0:23
arnold_w27-Jan-23 0:23 
GeneralRe: Why is my AlphaPanel approach to disable the entire GUI so slow? Pin
Gerry Schmitz27-Jan-23 6:24
mveGerry Schmitz27-Jan-23 6:24 
GeneralRe: Why is my AlphaPanel approach to disable the entire GUI so slow? Pin
Member 1590788429-Jan-23 8:05
Member 1590788429-Jan-23 8:05 
QuestionAn appraisal application with c# Pin
Emmanuel Bullem23-Jan-23 22:46
Emmanuel Bullem23-Jan-23 22:46 
AnswerRe: An appraisal application with c# Pin
OriginalGriff23-Jan-23 22:53
mveOriginalGriff23-Jan-23 22:53 
AnswerRe: An appraisal application with c# Pin
Pete O'Hanlon24-Jan-23 2:04
mvePete O'Hanlon24-Jan-23 2:04 
RantRe: An appraisal application with c# Pin
Eddy Vluggen24-Jan-23 13:54
professionalEddy Vluggen24-Jan-23 13:54 
Questionan appraisal application with c# Pin
Emmanuel Bullem23-Jan-23 21:50
Emmanuel Bullem23-Jan-23 21:50 
AnswerRe: an appraisal application with c# Pin
OriginalGriff23-Jan-23 22:53
mveOriginalGriff23-Jan-23 22:53 
QuestionIs possible to use the same background process for all forms? Pin
Member 1405587922-Jan-23 10:29
Member 1405587922-Jan-23 10:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.