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 trialAxel Valdez
1,815 PointsHow can I recreate these two documents in visual studio?
I'm not sure how to set up the documents so that I can follow along with the video. I'm unable to use the "Tower" class inside of the game file.
Axel Valdez
1,815 PointsI have no difficulty creating the two files. The problem is that whenever I try to create the "Tower" object in the game file the editor doesn't understand what I'm referring to. How can I solve this?
Jon Wood
9,884 PointsCan you share a screenshot for what it's doing and how your project structure looks?
Axel Valdez
1,815 PointsThis is the link for the screenshots :
Jon Wood
9,884 PointsMy guess is that the Tower
class may have a different namespace. I believe Visual Studio can import what you need. Click on where the red squigglies are and you should see a lightbulb icon. Click that and see if it gives you any options to reference the Tower
class.
2 Answers
Jon Wood
9,884 PointsHey Axel Valdez I think I see what's going on. It looks like you have a C# project that has each class of the game. Try to make yours look like this:
You can just move each of the files from the other projects into the Game
project and remove the remaining projects after that. Hope that helps!
Axel Valdez
1,815 PointsThank you very much Jon Wood, that fixed everything.
Jon Wood
9,884 PointsAwesome! Glad it helped!
James Churchill
Treehouse TeacherAxel,
Any chance you could upload your Visual Studio project to OneDrive or a GitHub repo?
Thanks ~James
Axel Valdez
1,815 PointsHere it is:
Jon Wood
9,884 PointsJon Wood
9,884 PointsIf I understand correctly, you should be able to just create a new solution and project (I'm guessing a console project) when you start up Visual Studio. From there you can add new files into the project as needed.