Getting Started
You will write your code with the Microsoft Visual Studio IDE. In this article, your will install Visual Studio and create a Console application.
You can download the IDE at the following link :
Download Visual Studio Community Edition (Free)
Create a console application
-
Open Visual Studio
-
On the start window, choose Create a new project
-
On the Create a new project window, enter console in the search box.
-
Choose the Console App (C#) template, and then choose Next
-
In the Configure your new project window, type or enter HelloWorld in the Project name box. Select a folder to store the project. Then, click the Next button
-
Select the Framework : .NET 7 (Standard Term Support) and click the Create button.
The application code
In the code editor, you will see the following C# code:
Console.WriteLine("Hello, World!");
The code will write a line of text, ‘Hello World!’, in the console window.
Run the application
-
In the top menu look for the HelloWorld application with a green play button and click it to run the application.
-
Ensure the application is set to run in ‘Debug’ mode.
-
View the result of your application code in the console window.
-
Close the console window when you are done.