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# C# Objects Object-Oriented Programming Fields

Rasmus Hall
Rasmus Hall
1,260 Points

CS1525 wtf

i wrote

using TreehouseDefense namespace TreehouseDefense { class Game { public static void Main() { Tower tower = new Tower(); Map map = new Map(); map.Width = 8; map.Height = 5; } } }

i do have other classes but they are all pretty much the same exept for

namespace TreehouseDefence { class Map { public int Width; public int Height; } }

but the only error is with game.cs (the one highest up) and it says

Game.cs(2,0): error CS1525: Unexpected symbol 'namespace'

PS i have tried removing the using (like it was before i debugged the script in the video) but then it all crashes

1 Answer

Henrik Christensen
seal-mask
.a{fill-rule:evenodd;}techdegree
Henrik Christensen
Python Web Development Techdegree Student 38,322 Points

I think you're getting the error because you forgot ; after using TreehouseDefense which by the way is not needed

What error message do you get if you remove the using TreehouseDefense?

Rasmus Hall
Rasmus Hall
1,260 Points

i get 100 errors from all the different files with the namespace TreehouseDefence

Henrik Christensen
seal-mask
.a{fill-rule:evenodd;}techdegree
Henrik Christensen
Python Web Development Techdegree Student 38,322 Points

"i get 100 errors from all the different files with the namespace TreehouseDefence" - Is the namespace "TreehouseDefense in some of your classes and TreehouseDefence in others? Because in your main-post you wrote TreehouseDefense, but now you're getting errors from files with namespace TreehouseDefence

Notice sometimes defense if written with s and sometimes with c (defence)

Rasmus Hall
Rasmus Hall
1,260 Points

THATS IT YOU'R A GENIUS! IT WAS A TYPO