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 trialCourtney Burgmann
443 PointsThe program is not launching when I write mono Program.exe to the console it just returns a new console line
The program is not launching when I write mono Program.exe to the console it just returns a new console line
9 Answers
Steven Parker
231,248 PointsMost likely your program is launching, but then ends without producing any output. If there had been a problem you would have seen an error message.
To facilitate a complete analysis, make a snapshot of your workspace and post the link to it here.
Shailendra kushwaha
1,523 PointsThe same problem happened to me, how can we solve this.
Steven Parker
231,248 PointsI see you started a new question, now post a snapshot of your workspace there.
Pitrov Secondary
5,121 PointsThe same problem to me http://w.trhou.se/wsi82ap7jw
Steven Parker
231,248 PointsThis is a perfect example of what I suspected in my first answer. So, if we look at your program code:
class Program
{
static void Main()
{
}
}
This is an "empty" program, it doesn't take in any input, and it doesn't produce any output.
So when you launch it, it will finish (successfully) and then you will get another console prompt.
Pitrov Secondary
5,121 PointsIts wierd, cause what i see in my workspace is this System.Console.Write("enter ur mins"); but this is not included in the snapshot, and i only have one file, I dont have Program.exe.
Steven Parker
231,248 PointsThe "Program.exe" file is created when you compile ("mcs"). And when you add code in the workspace editor, be sure to save your changes (with Ctrl-S or the "save" menu choice) before you compile.
Pitrov Secondary
5,121 Pointsoh I probbably didint save it here https://w.trhou.se/5av0giozk7
Steven Parker
231,248 PointsSo do you see the output line when you compile and run it now?
Pitrov Secondary
5,121 PointsNo, I do not see the output line.
Steven Parker
231,248 PointsAccording to the snapshot, the program code was changed at 4:00 PM, but it was last compiled at 3:06. So the version you were running was compiled from a previous edit.
I just compiled it again ("mcs Program.cs
") and then ran it ("mono Program .exe
") and I did see the message.
Dino Pearson
8,872 Pointsmake sure to save the file before you comple the code with mcs.
Daniel Green
840 Pointstry renaming the file, "Program.cs" to whatever you want and go thru the motions again. for some reason this worked for me.
Daniel Green
840 Pointsi ended up deleting all extra "cs" and "exe" files, closing workspaces, starting a new workspace and everything started working as it should in the video after this one. except the different error code numbers but the error description was the same.
chazber
4,873 PointsI had the same issue at first. Then I think I found the solution in the comments:
1) Save the workspace code 2) Compile the workspace code 3) Run the workspace code via "mono Program.cs"
Steven Parker
231,248 PointsYou got it, "edit, save, compile, run". And then "repeat as necessary".