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#

Game.cs(12,32): error CS1061:

when I try to compile:

mcs -out:TreehouseDefense.exe *.cs && mono TreehouseDefense.exe

it shows this error:

Game.cs(12,32): error CS1061: Type TreehouseDefense.Map' does not contain a definition forOnMap' and no exte nsion method OnMap' of typeTreehouseDefense.Map' could be found. Are you missing an assembly reference?
Map.cs(3,11): (Location of the symbol related to previous error)
Game.cs(16,27): error CS1061: Type TreehouseDefense.Map' does not contain a definition forOnMap' and no exte nsion method OnMap' of typeTreehouseDefense.Map' could be found. Are you missing an assembly reference?
Map.cs(3,11): (Location of the symbol related to previous error)
Compilation failed: 2 error(s), 0 warnings

I paused the video checked what did I missed. I am sure it was all the same just like how he codes it. Please help, I am stuck with this topic.

Steven Parker
Steven Parker
231,122 Points

To facilitate analysis, you can make a snapshot of your workspace and post the link to it here.

https://w.trhou.se/fcdh262bjr

Here is the snapshot.

Thank you in advanced

1 Answer

Jason Holt
Jason Holt
10,041 Points

The name of your method as it is written in Map.cs is onMap(). The call to the method is written as OnMap(). Have you checked the case on each letter?

Oh, thank you so much. Probably I was tired, did not see it. :)

Jason Holt
Jason Holt
10,041 Points

No problemo. Very common mistake when you’re tired or not!