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 trialLiam Andersson
1,396 PointsC# error
What's the error, been sitting here 10-15 minutes without a solution
Error:
Game.cs(9,17): warning CS0219: The variable map' is assigned but its value is never used
Map.cs(17,32): error CS1061: Type
TreehouseDefense.Point' does not contain a definition for X' and no extension method
X' of type `TreehouseDefense.Point' could be found. Are you missing an assembly reference?
Point.cs(3,8): (Location of the symbol related to previous error)
Compilation failed: 1 error(s), 1 warnings
1 Answer
Steven Parker
231,261 PointsIn point.cs, on lines 5 and 6 the variables "x" and "y" are declared, but these should be named "X" and "Y" instead (capital instead of lower case).
Then on lines 10 and 11, there should not be a "var" keyword in front of the assignments. Using "var" would create new variables limited to the scope of the constructor, but these lines are intended to give values to the previously declared variables.