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 trialLeonard Atorough
2,993 PointsPlacing Towers on Path help
So I started working on the solution while looking through previous discussions on the challenge. I found one particularly helpful solution which was built very similarly to mine and used it as a troubleshooter for most of my work. However, on attempting to compile so that I could run I got the following error:
error CS1061: Type `TreehouseDefense.OnPathException' does not contain a definition for `message' and no extension method `message' of type `TreehouseDefense.OnPathException' could be found. Are
you missing an assembly reference?
I'm nost sure how to handle this error and would like some help. I'm still very new to C#.
I've included code snippets of what I wrote:
Firstly I wrote the code that would check for the tower location and throw an exception, should the tower be on the path.
Then I went over to the Exception.cs file and wrote the exception handler.
Thirdly I went over to the Path.cs file and wrote the OnPath method. This was based on another students' solution. I was pretty much lost on this step.
And, finally, I went to Game.cs, added the exception handler and attempted to create a tower on the path to test it.
1 Answer
Edward Calvert
5,005 PointsLooks like it might be a typo! On the last screenshot, you type 'Message' with a lowercase 'm'.