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 trialErik Hainer
3,049 PointsConsole.WriteLine not printing to console
I've been using the Treehouse Workspaces to code, and unfortunately for the past few hours it just has not been printing to Console, when i use Console.WriteLine. I get no errors but it will not print. I'm not sure what to do.
Steven Parker
231,198 PointsIt would help to have access to the entire workspace to replicate the issue.
Take a look at this video about sharing a snapshot of your workspace.
Erik Hainer
3,049 Pointshere is my snapshot
1 Answer
Steven Parker
231,198 PointsIt was all in the commands, but I didn't notice until I tried them in the snapshot: ā
mcs -out:TreehouseDefense *.cs
ā this creates an output file named "TreehouseDefense"
ā && mono TreehouseDefense.exe
ā but this runs a file named "TreehouseDefense.exe"
if you run mono TreehouseDefense
instead, you'll get the expected output.
There was no error because an old file (that did not output anything) named "TreehouseDefense.exe" was already present in the directory..
Erik Hainer
3,049 PointsThank you! you're a lifesaver!
Erik Hainer
3,049 PointsErik Hainer
3,049 Pointshere is my main code:
here is my Point File
To run and compile, I type in console: mcs -out:TreehouseDefense *.cs && mono TreehouseDefense.exe
when i type ls into console, i receive: Game.cs Map.cs Point.cs TreehouseDefense.Exe Invader.cs Path.cs Tower.cs