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 Inheritance Throwing Exceptions

TreehouseDefense.MapLocation does not contain a constructor that takes 2 arguments

namespace TreehouseDefense { class MapLocation : Point { public MapLocation(int x, int y, Map map) : base(x, y) { if (!map.OnMap(this)) { throw new System.Exception(); } } }
}

I am getting an error saying TreehouseDefense.MapLocation does not contain a constructor that takes 2 arguments please help.

Steven Parker
Steven Parker
231,269 Points

The problem doesn't seem to be in that small code snippet above. Try sharing your entire project by making a snapshot of your workspace and post the link to it here.

https://w.trhou.se/rpxhv4d6ba

I think that is how you do it.

2 Answers

Steven Parker
Steven Parker
231,269 Points

Did you fix your issue before making the snapshot?

The snapshot is good, but when I built and ran your project I did not get the error you described (or any error).

Wow. There was an error a minute ago, thank you anyways. It means a lot that people are out there to help me learn, an answer my questions.