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

Compiler error CS0246

game.cs(7,7): error CS0246: The type or namespace name Map' could not be found. Are you missing an assembly reference? game.cs(9,7): error CS0841: A local variablemap' cannot be used before it is declared game.cs(10,7): error CS0841: A local variable map' cannot be used before it is declared game.cs(12,18): error CS0841: A local variablemap' cannot be used before it is declared

Yes, all namespaces are identical in spelling.

1 Answer

Steven Parker
Steven Parker
229,744 Points

When you build, did you include all sources? A typical build command might be:

mcs -out:TreehouseDefense.exe *.cs

If that's not it, please make a snapshot of your workspace and post the link to it here to facilitate a complete analysis.