Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

C#

Console not returning anything is workspace

I am doing the C# path, and when i write my code and either say dotnet run in the console or do exactly what the instructor is doing to compile the code nothing happens. It doesn't return any output or any errors it just goes down a line and awaits input like i didn't type anything at all. To test this I have copied and pasted my exact code into visual studios, and it compiles without errors. I would like to be able to just use workspace,but it seems like every lesson the same problem persists.

Have you tried this? Example file is Program.exe. You'd type the command "mono Program.exe" in order to run it after compiling. I had trouble with using dotnet run, too, but this way always worked.

1 Answer

Steven Parker
Steven Parker
220,378 Points

As caits suggested, the workspace environment is quite different from VS. The code is complied with the "mcs" command, and "mono" must be used to run the output file.

If you continue to have problems, you can use the "snapshot" function (the camera button) in the workspace to create a persistent link you can share here. With that, we can replicate your environment and take a closer look at the issue.