In this asp.net core tutorial, we are going to use the VS Code as an editor for our software development using ASP.NET Core applications.
For installing Visual Studio Code, please visit – https://code.visualstudio.com and download the respective version – macOS, Windows, Linux as per your development machine.
Installing .NET Core SDK
Download the SDK from Microsoft’s official website – https://dotnet.microsoft.com/download
At the time of writing this article, the latest stable version is .NET Core 3.1.
Create Your First ASP.NET Core Application
Now, the development machine is ready, let’s begin creating our first ASP.NET Core application and display “Hello World” on the web browser.
Open cmd by going to run (window + R) and enter the command given below. This command will create a new web app named aspnetcoreapp.
dotnet new webapp -o aspnetcoreapp
Now for running your app, use the following commands:
dotnet watch run
After the above command indicates that the app has started, open your web browser, and navigate to:
So now, you will be presented with a Welcome page. In order to display the “Hello World” message, Open Index.cshtml file under the Pages folder.
Modify the file as shown in the screenshot and then save the page.
Once, done with all these actions, refresh the page http://localhost:5001 and verify your changes as shown below.
We just build our first ASP.NET Core Application.