C# learning error

I just installed Visual studio express C# and try that tutorial.
http://www.csharp-station.com/Tutorials/Lesson01.aspx
Here is the codes. But trying to execute it, I got error. It is a rough start.

// Namespace Declaration
using System;

// Program start class
class WelcomeCSS
{
// Main begins program execution.
static void Main()
{
// Write to console
Console.WriteLine("Welcome to the C# Station Tutorial!");
}
}

Error#1
Error 1 Program ‘C:\Documents and Settings\n\Mes documents\Visual Studio 2008\Projects\WindowsGame1\WindowsGame1\obj\x86\Debug\WindowsGame1.exe’ has more than one entry point defined: ‘WelcomeCSS.Main()’. Compile with /main to specify the type that contains the entry point. C:\Documents and Settings\Christian\Mes documents\Visual Studio 2008\Projects\WindowsGame1\WindowsGame1\Game1.cs 7 17 WindowsGame1

#2
Error 2 Program ‘C:\Documents and Settings\n\Mes documents\Visual Studio 2008\Projects\WindowsGame1\WindowsGame1\obj\x86\Debug\WindowsGame1.exe’ has more than one entry point defined: ‘WindowsGame1.Program.Main(string[ ])’. Compile with /main to specify the type that contains the entry point. C:\Documents and Settings\Christian\Mes documents\Visual Studio 2008\Projects\WindowsGame1\WindowsGame1\Program.cs 10 21 WindowsGame1

#3
Error 3 The type or namespace name ‘Game1’ could not be found (are you missing a using directive or an assembly reference?) C:\Documents and Settings\Christian\Mes documents\Visual Studio 2008\Projects\WindowsGame1\WindowsGame1\Program.cs 12 20 WindowsGame1

#4
Error 4 The type or namespace name ‘Game1’ could not be found (are you missing a using directive or an assembly reference?) C:\Documents and Settings\n\Mes documents\Visual Studio 2008\Projects\WindowsGame1\WindowsGame1\Program.cs 12 37 WindowsGame1

The error messages say that you that there are two main() functions in your executable.

The main() function is the first function called by your computer when the program starts, it is the ‘entrypoint’ for your program. If there are two main() functions, your computer will not know which one to choose! Hence the error. Here are the two functions:

WelcomeCSS.Main() → The one from your code
WindowsGame1.Program.Main(string[ ]) → Which is somewhere else.

You probably need to remove/rename one of those. Since it is the WelcomeCSS.Main() you are currently using I’d suggest you get rid of the other one. :slight_smile:

thanks Timus.