Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

C# C# Objects Object-Oriented Programming Fields

The type or namespace name `Tower' could not be found. Are you missing `TreeHouseDefense' using directive?

Why do I get these errors?

Game.cs(7,11): error CS0246: The type or namespace name Tower' could not be found. Are you missingTreeHouseDefense' using
directive?
Game.cs(8,11): error CS0246: The type or namespace name Map' could not be found. Are you missingTreeHouseDefense' using di
rective?
Game.cs(10,11): error CS0841: A local variable map' cannot be used before it is declared Game.cs(11,11): error CS0841: A local variablemap' cannot be used before it is declared
Game.cs(13,22): error CS0841: A local variable `map' cannot be used before it is declared

I created the classes without any typo IMO. For example, this is my Map class:

namespace TreeHouseDefense { class Map { public int Width; private int Height; }

}

So what's the problem :(?

1 Answer

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there! According to the video, the namespace should be TreehouseDefense, but you have posted here a namespace of TreeHouseDefense. I feel like the problem is a typo in the namespace regarding the capitalization of the "H" versus "h". Try correcting that and see if you get some different results. Otherwise, we'll likely need to see a snapshot of your workspace.

Hope this helps! :sparkles:

Thank you very much, it solved the problem.