Saturday, January 19, 2019

Hello World .Net Core console App with Visual Studio

In the previous posts we saw on how to create a .Net Core console app using command line and using Visual Studio Code. In this post we shall create a .Net Core console app using Visual Studio. To begin with open Visual Studio, select New Project and select the template .Net Core -> Console App.




This will create a solution file, and a folder the files for the console app. The Program.cs file will be similar to the one which we saw in the command line example and VS Code example.

using System;

namespace HelloVS
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
            Console.ReadLine();
        }
    }
}

Just build and run the solution, a console window will open up and print Hello World in the console.


Search Flipkart Products:
Flipkart.com

No comments: