Why re-design ASP. NET ?, Redesign ASP. NET?

Source: Internet
Author: User
Tags http 2

Why re-design ASP. NET ?, Redesign ASP. NET?

Flexible cross-platform runtime requirements

Early. the. NET Framework version has been installed as a single and comprehensive whole. Each new version contains new features and almost all early functions, but is rarely deleted, this inevitably leads to an increase in the volume of the Framework. This mode ensures that Windows systems with the new Framework installed are compatible with all earlier versions. NET application, but it also means that each application will run on a large redundant framework, even if many features are not used in real projects.

Believe each. NET programmers have encountered the following embarrassing decision-making scenarios: when the Framework is notified of an update and release, whether to stop using new features to maintain application flexibility or use new features makes your Framework more huge!

To cope with the above scenarios. ASP. NET 5 provides three runtime options:

1.Full function. NET CLR 
Full function. net clr is the default runtime status of the Visual Studio project. It provides all APIs and is the best choice to maintain downward compatibility of applications.

2.Core CLR (cloud-optimized runtime) 
Core CLR is a streamlined, fully modular runtime. This CLR has been redesigned as a component so that you can only include the. NET features actually used in the project. Add the component as the NuGet package. Once the reference is completed, your application only depends on the required features. By splitting runtime components, we can change each component faster because each component has a self-updating mechanism. The core CLR is only 11 Mb in size. Compared with the full-featured CLR of MB, the core CLR will undoubtedly make the application lighter. Core CLR can be deployed along with applications, and different core CLR can run in parallel.

3.Cross-platformCLR 
Microsoft will launch cross-platform runtime for Linux and Mac OS X. This means that your. NET application is capable of running on Mac and Linux devices. Microsoft will work with the Mono community to complete this new feature. Before the release, you can use Mono CLR for cross-platform development.

By default, the full function. net clr is used to create a new Visual Studio project. You can change it to the core CLR on the project properties page.

Flexible Deployment

ASP. NET 5 allows application deployment to IIS, or independent deployment from IIS. When the target Framework is set to Core CLR, you can use the dependencies in the deployment package to deploy the application. Therefore, your application is self-contained and does not rely on the full-featured. NET version. This application can run on any device or platform.

This pair. NET platform developers are no doubt a surprise. Deploying applications is not limited to IIS. Of course, Microsoft still recommends that you deploy applications using IIS. However, if you need to deploy applications on a platform that is not compatible with IIS, you can use this new feature to perform operations.

In subsequent articles, we will release how to create MVC6 applications that do not depend on IIS.

Multi-version. NETConcurrent Use

Earlier versions. NET Framework, you will always be faced with the choice of whether to update the version. On the one hand, you want to use the UPDATE function, on the other hand, you will be able to smoothly migrate the project developed for the old version to the new version. NET Framework.

Microsoft has improved the above problems in ASP. NET 5. With the core CLR, you can define dependencies in the deployment package, so you can specify the. NET version for each application. The old application can run smoothly, and you can also use the new version to develop the application. Therefore, the. NET Applications of multiple versions in ASP. NET 5 are parallel.

Simplify dependency management

ASP. NET 5 introduces a new lightweight dependency relationship management mechanism. Instead of adding a reference to an application, you can use the NuGet package instead. You can add a NuGet Package through the NuGet Package manager, or edit a JSON file containing the NuGet Package list and version information (project. json) for reference. The project. json file is used to list NuGet-related information used by the application. To add other references, add them directly to the JSON file.

Merge MVC, Web API, and Web pages

In earlier versions, MVC, Web APIs, and Web pages have been implementing the same functions in different ways. For example, both MVC and Web APIs provide routes, but the MVC routing class is in the System. web. mvc. in the Routing namespace, while in the Web API, similar classes are in the System. web. http. routing namespace. For another example, both Web pages and MVC have the Razor syntax, but they are still included in different NuGet packages with the same function.

In ASP. NET 5, MVC, Web API, and Web page are integrated into the same framework-MVC 6. This means that the repeated functional modules are removed to simplify application development.

In the preview version, MVC and Web APIs are first merged into MVC 6.The Web page will be added later in subsequent releases.

Enhancing HTTP Performance

ASP. NET 5 provides a refined and fast HTTP request pipeline that allows you to add only the required components. by reducing the overhead of the pipeline, applications will have better throughput.

Cloud deployment capability

When you create a new ASP. NET 5 project, this project has a structure that can be easily deployed to the cloud by default. Visual Studio 2015 provides a new environment configuration system to replace the Web. config file. The new system allows multiple file types (such as JSON, XML, or environment variables) to store key-value pairs. Therefore, you can easily specify or obtain these values in any environment.

ASP. NET 5 provides a tool to detect and track problems with deployed cloud applications.

Integration dependency Injection

Dependency injection is embedded in ASP. NET 5. You can use the IoC container to register dependencies. Dependency injection promotes the provision of the correct service environment.

Open Source

ASP. NET source code has been released to GitHub. Not only does the source code of the current version be provided, but Microsoft also promises to synchronously update the source code in GitHub. You can view ASP. NET changes in time, download the changes, and submit the changes to GitHub.

This helps you understand ASP. NET code and technology trends, and you can customize your own ASP. NET.

About Web Forms

Microsoft has been committed to providing users with new features to improve the development experience. You can still develop Web Forms applications and add the following new features in Web Forms 4.6:

  • HTTP 2
  • Asynchronous binding mode
  • Roslyn CodeDOM Compiler

Web Forms applications developed in earlier versions can run directly under the IIS. NET 4.6 framework without any changes. However, the new core CLR features of ASP. NET 5 cannot be used.

For example, an application is currently developed using Web Forms, MVC 5, Web API 2, SignalR 2, Web Pages 3, or Entity Framework 6, you only need to set the current runtime version to full-featured runtime without any code-level modifications.. NET 5. However, the core CRL is a new feature of ASP. NET 5. If you want your application to have the runtime function, you need to make some modifications. Microsoft provides the API Portability Analyzer tool to determine whether the current application can use the core CRL. This tool also analyzes the platforms on which the current application can run and the factors that prevent it from running on a specific platform. The required changes and new interfaces are also prompted.

MVC 6 and SignalR 3 applications use new HTTP pipelines, so they cannot be compatible with applications that use the System. Web interface. To upgrade an existing application to mvc 6 or SignalR 3, you must use Visual Studio 2015 to create a new project and then import the original project. During the import process, you must modify unsupported code snippets.

 

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.