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#

How to do I write/format code better in Visual Studio Community when doing projects.

Good day, I started doing the C# practice sessions in the library, this particular exercise is based on creating media type files. so I finished the first part in visual studio and it had 60 errors while in the workspace it compiled without error, after trying and trying I gave up, then decided to paste the code from what was in the workspace to visual studio, it compiled without any errors. Could someone please explain exactly what went wrong because my code was word for word in the exercise plus my brackets were in alignment.

Thank you

2 Answers

Steven Parker
Steven Parker
229,771 Points

Clearly, the code that caused the errors originally was different from the code you pasted in later an ran without errors.

You might try comparing the two versions to each other. The "diff" tool provided in the workspace might be helpful.

Will try that, thanks

Steven Parker
Steven Parker
229,771 Points

If you still need help you might put both versions into separate folders of a workspace, and then make a snapshot of the workspace and post the link to it here.