The C # .net core - Creating project

 

First, create a new Web application

 

 

Second, the basic information of the selected item (.net coer 2.2 and procedures with trying controller)

  This is similar to the MVC mode, you can also use other, in short, what needs to choose what

 

 

 three,

 Then you can both see such a list

 

Start clicking, you can see the Demo, probably like this

 

 

But their own words the Demo project or delete it.

Four, said the following at a few documents that role.

  Account of what top to bottom

  1, Connected Services (Connection Service)

  Literally understood, is connected to the service, click, you can see the connection gethub, what cloud services, then the function is released. The basic need.

  2, Properties (Properties)

  This open solution with the right-click Point Properties is a meaning. Configuring basic properties of some projects, this could not BUG basic need. But that debugging, you can deploy the local IP address of a production IIS, and easy to use LAN access. You can refer to this. . .

  3, wwwroot (at stations directory)

  This is the root directory, after opening the can see there is a css, and js files. The actual point that, after you've published your project, that he is not with the project to generate a DLL (this is nonsense, css, js files has always been not generate dll's), if the need to change the style here changes directly on it, total styles can not be changed once released it. Considered a norm.

  4, dependencies

  It is a reference to the package or project

  5、Controllers、Models、Views

  A model MVC, Views Models data retrieved by Controllers.

  6、appsettings.json

  Webconfig the equivalent, in which you can configure some global things, such as the interface IP, apptoken. However, this needs to be configured before they can use it.

  7、Program.cs

  Point into a Main method can be seen, the program Click here to make a break, you will find that he go first this method. The main entrance of the project.

  8、startup.cs

  This comes from: https://www.cnblogs.com/qtiger/p/11175177.html

  Startup类有两个方法ConfigureServices(可选)和Configure(必选),主机提供 Startup 类构造函数可用的某些服务。 应用通过 ConfigureServices 添加其他服务。 然后,主机和应用服务都可以在 Configure 和整个应用中使用。

  ConfigureServices将服务添加到服务容器,使其在应用和 Configure 方法中可用。 服务通过依赖关系注入或 ApplicationServices 进行解析。

  Configure 方法用于指定应用响应 HTTP 请求的方式。 可通过将中间件组件添加到 IApplicationBuilder 实例来配置请求管道。(中间件具体将在ASP.NET Core 基础知识(六)中间件介绍)  

 

简单的解释就这些。

  大部分都是自身的理解,如有不当之处欢迎指正。

 

 

 

Guess you like

Origin www.cnblogs.com/hkzw/p/12001420.html