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 trialSandra Gury
6,911 PointsErrors, namepaces not found
Here is a snapshot of my work: https://w.trhou.se/mvb18tgqxy
I don't understand because I did exactly like the teacher but I got those error messages:
Game.cs(9,11): error CS0246: The type or namespace name Map' could not be found. Are you missing
TreehouseDefence' using directive?
Game.cs(11,11): error CS0246: The type or namespace name Point' could not be found. Are you missing
TreehouseDefence' using directive?
Game.cs(12,26): error CS0841: A local variable map' cannot be used before it is declared
Game.cs(15,23): error CS0246: The type or namespace name
Point' could not be found. Are you missing TreehouseDefence' using directive?
Game.cs(15,11): error CS0841: A local variable
point' cannot be used before it is declared
Game.cs(16,21): error CS0841: A local variable map' cannot be used before it is declared
Map.cs(16,13): error CS0103: The name
inBounds' does not exist in the current context
1 Answer
Joel Saunders
1,850 PointsIt looks like you just have a typo when declaring your namespaces.
For example, in your Game.cs file the Game class is in the "TreehouseDefense" namespace while in your other files the namespace is "TreehouseDefence".
I believe that should solve all of your errors but let me know if it doesn't.
cheers