In this article we will learn how to create a step by step ASP.NET Core web application with razor pages. Prior to going the particle part let's know about the ASP.NET Core.
What is ASP.NET Core?
ASP.NET Core is an open source cross platform framework for developing and building web, cloud, IoT applications.
Why should we use ASP.NET Core?
- ASP.NET is an open source platform which runs on Microsoft .NET Core Framework.
- We can build and run the ASP.NET core application on a cross platform environment such as Windows, MacOs, Linux etc.
- We can build modern apps such as Cloud, IoT, Web apps, mobile backend etc. and those can be easily enabled to run over the cloud platform.
- We can host application on any modern platform such docker, AKS etc.
- Saves the efforts of the developer by built-in features such as dependency injection, you can enable docker, containerization, swagger support in just one click.
Step 1: Open Visual Studio
- Open Visual Studio ( I am using 2019)
- Once the Visual Studio Opens, Then click on Continue Without Code as shown in the following image
- Then from Visual Studio Menu, click on File => New Project, as shown in the following image
Click on the New Project, then the following window appears as shown in the step 2.
Step 2: Choose Project Template
- ASP.NET Core Web App: This project template creates the web application with Razor pages without Model, View, Controller.
- ASP.NET Core Web App (Model-View-Controller): This project template creates the web application with Model, View, Controller (MVC).
Step 3: Define Project Name and Location
Step 4: Choose the Target Framework
After providing the required details, click the create button. It will create the ASP.NET Core web application with razor pages as shown in the following image.