[03-2] VS2017 create a ASP.NET Core Web program

VS2017 create a ASP.NET Core Web program

Author: Liang Tongming - Microsoft Most Valuable Professionals (Microsoft MVP) 
article will be updated with the release, I get concerned about the latest version of 
this article comes from "scratch learning ASP.NET Core and EntityFramework Core" directory 
Better Video Course effects: cross platform development and combat to master ASP.NET Core EntityFramework Core 

Creating ASP.NET Core Web Application

If you are using VS2019 see  VS2019 create a ASP.NET Core Web program (c)

In this video we will discuss

  • Available in different project templates and their functions
  • Prefabricated any different project templates, which can be used, as well as their role.

Create a new ASP.NET Core project in the Visual Studio2017

Step 1: Create a new asp.net Core project in Visual Studio 2017

Step 2: Click the file in Visual Studio - New - Project.

Step 3: In the "New Project" dialog box, expand the "Installed." Then expand "Visual C #" and select .NET Core

Step 4: In the middle pane, you will find all of the items installed templates. For example, you will find for creating .NET console application, library, unit test project (use MSTest, NUnit or xUnit frameworks), template ASP.NET Core Web applications.

Step 5:

3 1 1

We want to create "ASP.NET Core Web Application." Therefore, select "ASP.NET Core Web Application"

Step 6: In the "Name" text box, type the name of the project. I named it StudentManagement. We will create a asp.net core web application, in this program, we will create, read, update, delete students.

Step 7: In addition, the position to be created for this project. I will put my project, path, C: \ Projects \ source \ repos folder.

Step 8: On the next screen, select ASP.NET Core 2.2 (the latest available at the time of this recording .NET Core SDK) 3 1 2

Step 9: deselect the "configure the HTTPS" check box, as shown above, the authentication off.

This screen shows the different project templates can be used to create ASP.NET Core applications.

A brief description of each template

Empty: The name implies "empty" template does not contain any content. This is 我们将使用的模板, to start from scratch and manually set all of the content, so that we can clearly understand how the different parts together.

Web applications (model-view-controller): This template contains created Model, View (Views) and the controller folder and add specific Web content, such as CSS, JavaScript files, other resources required layout files and Web sites, you can also HTTP service based on this template to create a Restful style.

The following screen shot shows I use Web应用程序(模型视图控制器)projects created. Please note that we have Modes, Views, and Controllers folder. In the Views folder, we have an example of view files and layout files, they represent the user interface of the Web application. We also have Web applications often need JavaScript and CSS files.

3 1 3

API: This template contains create ASP.NET Core RESTful HTTP services required for all

AP I do not need all site-specific content, such as JavaScript files, CSS files, view files, layout files, because it has no user interface. Web API publicly available data commonly used by other applications, can be simply understood as the deal between the program and the program.

Therefore, API will create a template Controllers folder. It does not create Models and Views folder because they are not necessary for the API. The following screen shot shows the items I use the API to create a template. Please note that we only Controllers folder. We do not have all the JavaScript, CSS and layout files RESTful API unnecessary.

3 1 4

Web Application: This template uses new RazorPages framework for building Web applications. Use Razor pages, written in page-centric scene easier and more efficient. When we do not want the full complexity of ASP.NET MVC, we usually use this method. We can be regarded as a thinner version of the MVC framework. We will discuss in detail in the video RazorPages upcoming release.

Razor Library (RCL): As the name suggests, we use this template to create Razor reusable class library project. The program contains all the user interface portion may be multiplexed, such as data models, page model, controller, pages, view and Razor View components. Then, this may be multiplexed Razor library (RCL) projects in multiple applications. RCL use any application that can cover and page views it contains. RCL we will discuss later in the video released.

Angular, React.js, React.js and Redux: This template allows us to three and Angular, create asp.net Core Web application or React React together and Redux.

In the next article, we will explore and understand ASP.NET Core project file.

Summary

In this article, I try to explain how to create a project from scratch, and the difference between different types of templates. I hope this article can help you meet your needs. I would like to receive your feedback. Please post your feedback, questions or comments on this article.

Article Description

If you think my article quality is good, welcome a reward, you can also subscribe to my video Oh, 
is not authorized are not allowed to reprint this article, 52abp.com retain the copyright 

Thank you for supporting me

Guess you like

Origin www.cnblogs.com/wer-ltm/p/11028205.html