C#: First Blog Console App

To run first C# program you need to have dotnet SDK installed on your local machine which you are going to use for C# programming.

Note: this blog represents sample which is prepared using Visual Studio Code IDE.

Go to location on you machine where you want to write program.

To print let's create first console app.

1. Open Visual Studio code and open folder where we are going to run first console app and click on New Terminal.


2. Run the following command to create console app.
    dotnet new console --framework net6.0 --use-program-main

3. Now we have boilerplate console app, which looks like following screenshot.
  

 


4. To print Hello world on the same terminal execute folloing command.
> dotnet run
    which should look like following



Hope this helps to create first console app using dotnet.




Comments