π Instructions#
Your project already contains a working program β open the main file and you’ll see a single instruction waiting for you. This instruction tells the computer to display text in the console. It’s the simplest program you can write β one instruction, one result. You didn’t write it, but you’re about to run it.
Console.WriteLine("Hello, World!");π§ Recall
π Learn More
β What to Do#
Run the program using dotnet run in the terminal.
π― Expected Outcome#
Hello, World!
π‘ Hints#
Hint 1
Open the terminal in VS Code from View β Terminal. This is where you type commands.
Hint 2
Make sure the terminal is inside the ConsoleGamesLibrary folder β you should see it in the prompt. Then type dotnet run and press Enter.
β οΈ Common Mistakes#
Typing the command in the wrong place
dotnet run is a terminal command β it goes in the VS Code terminal panel at the bottom, not in Program.cs or the Command Palette. Open the terminal from View β Terminal.
Terminal is in the wrong folder
If the terminal shows a folder other than ConsoleGamesLibrary, dotnet run will fail with Couldn't find a project to run. Navigate into the project folder with cd ConsoleGamesLibrary before running.
Output doesn’t match
The expected output is Hello, World! β with a comma and an exclamation mark. If yours shows something different, check that Program.cs hasn’t been edited since the project was created. It should contain exactly Console.WriteLine("Hello, World!");.
π Solution#
Tried, you must, before reveal the solution you may.
- Open the terminal from View β Terminal.
- Run:
dotnet run