ASP. NET 5 (vNext), asp. netvnext

Source: Internet
Author: User
Tags install node

ASP. NET 5 (vNext), asp. netvnext

 

Overview

ASP. NET 5 (also known as vNext) is a revolutionary update generated over the past 15 years since ASP. NET. We can understand its overview and significance from the following points:

  • ASP. NET 5 is open-source
  • Webapps developed by ASP. NET 5 are cross-platform: currently, platforms that can be confirmed include Windows, Linux, and Mac
  • ASP. NET 5 is based on the OWIN standard and has been completely isolated from System. Web. dll. In other words, vNext does not have to be set up on IIS.
  • ASP. NET 5 is a fully componentized development. developers can select functional components from scratch.
  • ASP. NET 5 perfectly supports cloud deployment
  • ASP. NET 5 development environment requires VS 2015 support
Running Environment

ASP. NET 5 is running in the new Runtime Environment Framework:. NET Execution Environment (DNX.

In short, DNX integrates all required SDK and runtime environment content for ease.. NET applications can run across platforms. DNX is a new concept. For more information, see the DNX Overview document.

Component Management

As you can guess from VS 2013, 2015 of Component Management is Nuget, and NPM is also supported to install Node. Js components.

However, VS2015 is more strict than VS 2013. Nuget is not an option but a required option. The mode of directly adding DLL is canceled. All components must be added in Nuget mode.

Startup class

The only Startup entry for ASP. NET 5 is the Startup class (which is familiar with OWIN). The sample code is generally:

public class Startup{     public void ConfigureServices(IServiceCollection services)     {     }     public void Configure(IApplicationBuilder app)     {     }}

The ConfigureService method is used to define services in the entire application, while the Configure method is used to define the Middleware (Middleware) loaded in the entire application)

Service)

Dependency injection-based component implementation. For example, Attribute in Controller is a typical Service component. ASP. NET 5 has a certain default Service, but they can also be easily implemented throughConfigureServicesReplace the function.

Middleware (Middleware)

Based on the OWIN theory, we can know that we use Middleware to manage Request pipelines (Request Pipeline). This is different from IIS's many preset processing mechanisms. If there is no Middleware loading, this MPs queue is considered empty. we can useConfigureThe Use method of the IApplicationBuilder parameter in the function adds the required Middleware in sequence.

Of course, ASP. NET 5 also provides several standard Middleware:

• Working with Static Files: mainly refers to the Static file function, based on the ASP. NET StaticFile component.

• Routing: mainly refers to MVC and WebApi-related functions, Based on ASP. NET Mvc components.

• Diagnostics: mainly refers to the functions related to Logging.

• Authentication: mainly refers to user Authentication related functions, Based on ASP. NET Identity component.

In addition, developers can customize any Owin-compliant middleware and add it to applications.

Server Configuration

ASP. by default, IIS and Self-Hosting (based on the WebListener component) are supported. Note that the functions of these two modes are identical. self-Hosting can easily run your application without IIS in Windows. on other platforms, you can choose other Server implementations based on Owin standards, such as Kestrel web server. (the code and implementation are consistent)

Static file directory

When loading the StaticFile component, we need to set the static file root directory of the entire project at the same time. This configuration is generally in the project configuration file: project. in the json "webroot" attribute, the default value is wwwroot.

Configuration

ASP. NET 5 uses a new configuration file System, the new System is not based on System. configuration or web. config, the new configuration file system has a large number of configuration files to provide components (configuration providers). These components can easily support a variety of configuration file types (XML, JSON, INI or even system environment variables), developers can even develop custom configurations to provide components.

By default, ASP. NET 5 configuration files are generally project. json and config. json.

End

If you want to try it, you can install VS2015 RC for research.

Https://www.visualstudio.com/en-us/downloads/visual-studio-2015-downloads-vs.aspx

Note that when creating a Web App, do not select the above MVC 4.6, but select the following vNext.

MVC 4.6 is similar to the current mechanism and has little significance.

The project_readme.html file in the project contains more details. If you are interested, you can learn it together.

Conclusion 2Sentence: MSThis is really a fight,Open source,Cross-platform,Componentized; AngularJS, JQuery, BootStrapHas become a standard, Grunt and GulpEnter the room,You can even directly perform Node. JsDevelopment.

In addition, if you want to follow MSStem, ASP. NET 5Definitely an upgrade worth considering.

 

References

Introduction to ASP. NET 5

DNX Overview

Client-Side Development

Related Article

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.