Project Templates in ASP.NET Core Application

Project Templates in ASP.NET Core Application

In this article, I am going to discuss Project Templates in ASP.NET Core Applications. Please read our previous article, where we discussed How to Create, Build, and Run ASP.NET Core Applications using ASP.NET Core CLI Commands.

Project Templates in ASP.NET Core Application

Using ASP.NET Core, we can create different types of Web Applications. As you can see in the below image, while creating ASP.NET Core Web Application, we have different types of project templates for creating ASP.NET Core Web applications.

Project Templates in ASP.NET Core Applications

So, let us discuss a little about all these project templates. We will use these project templates to build the ASP.NET Core Web application in our upcoming articles.

ASP.NET Core Empty Project Template: 

As the name says, the ASP.NET Core Empty Project Template does not have any content by default. If you want to do everything manually from scratch, then you need to select the Empty Project Template. The following image shows the structure of an Empty template.

ASP.NET Core Empty Project Template

As you can see, the above project template contains the only basic files required for any ASP.NET Core Web Applications. In this case, we need to add everything manually. To learn the basic concepts of ASP.NET Core, we need to use ASP.NET Core Empty Project Template. In fact, as of now, we have used this ASP.NET Core Empty Project Template to understand the basic concepts.

ASP.NET Core Web App Project Template

This project template is used for creating ASP.NET Core Web Application using ASP.NET Core Razor Page Content. The Web Application Template uses the new Razor Pages framework for building web applications. The new Razor Pages make coding page-focused scenarios much easier and more productive. We need to use this project template when we want to develop a web application but do not want the full complexity of ASP.NET MVC. The following image shows the structure of the ASP.NET Core Web App Project Template.

ASP.NET Core Web App Project Template

ASP.NET Core Web App (Model-View-Controller) Project Template

The ASP.NET Core Web App (Model-View-Controller) Project Template contains everything that is required to create ASP.NET Core MVC Web Application. The ASP.NET Core Web App (Model-View-Controller) Project Template creates folders for Models, Views, and Controllers. It also adds web-specific things such as JavaScript, CSS files, Layout files, etc., which are necessary and required in order to develop a web application. The following image shows the default file and folder structure of the ASP.NET Core Web App (Model-View-Controller) Project Template.

ASP.NET Core Web App (Model-View-Controller) Project Template

ASP.NET Core Web API Project Template

The ASP.NET Core Web API Project Template contains everything required to create an ASP.NET Core RESTful HTTP service. The following image shows the default structure of the ASP.NET Core Web API Project Template. As you can see from the below image, it contains only the Controllers folder. The website-specific things such as CSS files, JavaScript files, view files, layout files, etc., are not present. This is because an API does not have any user interface; hence it does not include such website-specific files. This API template also does not have the Models and Views folder, as they are not required for an API.

ASP.NET Core Web API Project Template

Note: You can also create an asp.net core web application in combination with Angular, React or React, and Redux.

In the next article, I am going to discuss How to set up .NET Core Application on GitHub Repository. In this article, I explain Project Templates in ASP.NET Core Applications. I hope you enjoy this article.

Leave a Reply

Your email address will not be published. Required fields are marked *