I'm an absolute beginner and currently trying to follow the Lynda - Learning C# tutorial to start my coding journey.
Unfortunately I've run into trouble on the first task - to run the default template "hello world" code. I've double checked that i have installed Visual Studio 2019 as directed (.NET desktop development) and created the appropriate project template (Console App with .NET core). This then loads a template program identical to the lynda tutorial. See below:
VS19 Screen Cap
What I've noticed is the following:
Debug> Start Debugging/ Start without Debugging" are both greyed out
The green "play" button on the menu bar says "attach" rather than the project name as in the tutorial
In the solution explore panel - there are 0 projects whilst in the lynda tutorial the Hello World project appears with sub-menus of "dependencies" and "program.cs"
Appreciate any help!
CodePudding user response:
Thanks all for your contributions - @CaiusJard @Dailosrs @AlexLeo
I'm not entirely sure what went wrong in my first installation of VS2019 as I had followed the tutorial exactly.
It seems that a fresh install of CS2022 has fixed the issue and the default code when opening the default template now both allows me to Start Debugging/ Start without Debugging and appears as a project in the Solution Explorer
CodePudding user response:
As the name suggest a template is like a blue print and it can be used to create something from it. You can not use a template as is to create a solution/projects.
So you could add the template to your VS - but since you are a beginner I suggest do as Caius Jard suggests - follow the Microsoft link to create a console application(pretty straight forward) call it Hello World. Once it has been created you will see in the left hand side your Solution and Project.
There would be an handful of files, most important is the Program.cs that will look similar( probably the same) to the templates shown in your picture.
Simply add
Console.Writeline("Hello World");
and then F5.