Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

C# C# Objects Object-Oriented Programming Fields

Error CS 10017

"Program Game.exe has more than one entry point defined" Why do I keep on getting this error? My code is: namespace TreehouseDefense { class Game { public static void Main() { Map map = new Map();

      map.Width = 8;
      map.Height = 5;

      int area = map.Width * map.Height;
    }
}

} namespace TreehouseDefense { class Map { int Width; int Height; } } And so on.

1 Answer

Steven Parker
Steven Parker
231,198 Points

To share the entire project, make a snapshot of your workspace and post just the link to it here.

But based on the error message, the problem is likely elsewhere in the code. Check to see if there is more than one module with a "Main" method in it.

I didn't know that there had to be only one main method so I put them in all of my code. I thought it was like the start method. Thanks!