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 trialPratham Patel
4,976 PointsI keep getting a namespace error and anthor error saying a local variable map cannot be used before it is declared
help
Pratham Patel
4,976 Pointshere's my workspace https://w.trhou.se/ik4qgeike0 The files game.cs and map.cs wont compile neeed help
3 Answers
Robertin Datkov
11,558 PointsHeya there mate. I saw your code. So your problem is basically on Map.cs you have your namespace named -TreeHouseDefense And on your Game.cs it is TreehouseDefense with lower H. Just change your namespace on Map.cs to TreehouseDefence and you'll be fine :)
Mark Wilkowske
Courses Plus Student 18,131 PointsHey Rakesh, in Game.cs the area variable has a typo in the height field. Change to map.Height.
Eric Perry
7,021 PointsMake sure before you compile it that you Save All instead of just Save
Steven Parker
231,198 PointsSteven Parker
231,198 PointsYou'll need to share your code to make it possible for someone to assist.
You can share everything at once if you make a snapshot of your workspace and provide the link to it.