Step-by-step learning ASP. NET 5 (iii)-Understanding the new web structure

Source: Internet
Author: User
Tags sublime text ruby on rails

Editor's note: Today Microsoft's two major events, in the morning there is a long-lost Microsoft HEC 2015 Night dotnetconf 2015. How can you miss it if you do Microsoft's technology? Tell me about my serial, the first two articles describe the environment configuration of ASP. NET 5 and complete the development work on the lightweight sublime text. Start talking about the basic structure of ASP. NET 5 today. Let's say I temporarily migrated my work platform to surface Pro 3 on the next section.

Speaking of ASP, I started from 1.0 Beta to now 5.0 (exposed age), two things are special excitement, the first is from the WebForm transition to MVC, The second thing is ASP. 5.0. These two changes Microsoft has adopted many new ideas and the realization way. For example, ASP. NET MVC was transformed from the most popular Ruby on Rails of the year.

Today, ASP. NET 5.0 has taken a lot of Nodejs's advantages. Microsoft is also more fashionable in this respect.

Here's how to start with the basic architecture of ASP. NET 5 Web (for example)

        

0. Yes or MVC-get started on the official website without knowing


1. New Configuration method

Look at the items you found in Web. config or another directory on the config-order file is missing (it is always a pain to read/write such XML). True words, do technology is certainly not a marriage, you need to hate. So where's the new ASP. NET 5 profile? It must be simpler and easier to customize different profiles (Xml,json) in the way that you like it. INI is available). Initializing the configuration is done in ASP. Startup.cs instead of Web. config in net 5.

such as the dependencies of packages and packages in the project, the ability to upgrade the package version number, start the page, and so on.

This configuration is started from IConfiguration.

Let's say you want to know a lot of other things to ask Https://github.com/aspnet/Configuration.

2. Project.json

This is the package you want to configure for your project. The primary file for the compilation settings, resource files.

He is set up through JSON files.

There are several fields that are more relational

Dependencies: Set up the packages you need in your project, and when you use KPM rebuild, you load your package according to this, assuming that the version number of your package is updated to be set up here as well.

For example, the base package required to set up a new project (JSON is easier to read than XML)

Framework: Set the required packages for ASPNET50 and Aspnetcore50.

Command: Sets the number of parameters after the execution K (DN), such as setting the start service and port of the Web/kestrel, Unit test, or Entity Framework support.

Need to know a lot of others please come here Https://github.com/aspnet/Home/wiki/Project.json-file


3. Config.json

Configure the database connection and your corresponding ORM engine, where the entity Framework 7 is the default. I would prefer to have a lot of other ORM engines added in.


4. Front-end configuration Npm/bower/grunt

Your project needs to introduce JS library/bootstrap, etc., in the past need to be downloaded in the project. In order to save time Npm+bower will be able to help you find. and grunt more convenient to help you deploy the project when the collation/compression of your JS, the specification of your JS code.

It's more like Nodejs, or imitation.


You should now have a basic understanding of the structure of an ASP. NET 5 project and continue tomorrow.

Or a lot of communication!


Step-by-step learning ASP. NET 5 (iii)-Understanding the new web structure

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.