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 Methods Return Values

Alwin Landler
Alwin Landler
1,070 Points

Error CS1061

Hello, I am getting the following compilation error:

"treehouse:~/workspace$ mcs -out:TreehouseDefense.exe *.cs && mono TreehouseDefense.exe
Map.cs(19,20): error CS1061: Type TreehouseDefense.Point' does not contain a definition forx' and no extension method x' of typeTreehouseDefens e.Point' could be found. Are you missing an assembly reference?
Point.cs(3,9): (Location of the symbol related to previous error)
Compilation failed: 1 error(s), 0 warnings "

Here are my screenshots: https://w.trhou.se/wp92ss1cs7 https://w.trhou.se/psoa3lnbyo

Can anyone help me find out what I am missing? Thanks in advance

Deyan Svetoslavov
Deyan Svetoslavov
5,959 Points

The fields in Point.cs are upper case and in Map.cs they are lower case - change in Map.cs point.X (to upper)

2 Answers

Steven Parker
Steven Parker
231,248 Points

As Deyan mentioned, the names on line 19 of Map.cs are just in the wrong case. Here's that line corrected:

      return point.X >= 0 && point.X < Width && point.Y >= 0 && point.Y < Height;
Alwin Landler
Alwin Landler
1,070 Points

Thanks a lot guys, that was it. It's so easy to overlook something.. :)