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 trialAhmed M
4,008 Pointserror CS0246
Game.cs(15,25): error CS0246: The type or namespace name `MapLocation' could not be found. Are you missing an asse mbly reference? https://w.trhou.se/x7o6nubmd4
2 Answers
zalkortis
10,332 PointsOkay, I'm sorry. I had a short recap of your code again.
The issue was not because it wasn't public, but it was because there is a typo in the method MapLocation within that class. The code says Maplocation instead of MapLocation.
Try to change it back to this:
using System;
namespace TreehouseDefense
{
class Maplocation : Point
{
public MapLocation(int x, int y) : base(x, y)
{
}
}
}
zalkortis
10,332 PointsYou need to make your MapLocation class public.
namespace TreehouseDefense
{
public class Maplocation : Point
{
public Maplocation(int x, int y) : base(x, y)
{
}
}
}
Ahmed M
4,008 Pointsi did it now it doing this
MapLocation.cs(5,18): error CS0060: Inconsistent accessibility: base class TreehouseDefense.Point' is less access
ible than class
TreehouseDefense.Maplocation'
Ahmed M
4,008 Pointsi did it! thank you ;)