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 trialLouis Nathan
2,598 PointsError CS1644: Feature 'primary constructor' cannot be used because it is not part of the C# 6.0 language specification
Game.cs(3,13): error CS1644: Feature `primary constructor' cannot be used because it is not part of the C# 6.0 language specification
Compilation failed: 1 error(s), 0 warnings
Louis Nathan
2,598 PointsGame class
namespace TreehouseDefense {
class Game() {
public static void Main() {
Map map = new Map();
map.width = 8;
map.height = 5;
int area = map.width * map.height;
}
}
}
Map class
namespace TreehouseDefense { class Map { public int width; public int height; } }
1 Answer
Steven Parker
231,236 PointsWhen defining the "Game" class, don't put parentheses after the class name.
Steven Parker
231,236 PointsSteven Parker
231,236 PointsYou forgot to show your code. Please make a snapshot of your workspace and post the link to it here.