ASP.NET 5 – Top Features

ASP.NET vNext is a new versatile framework that is compatible with Windows, Linux, or Mac OSX, with lots of new features. One of the most exciting features is that it’s open source (which Microsoft RARELY does) and available on GitHub.  Joydip Kanjilal did a great article on the top 10 features that are available in version 5 of ASP.Net on Infoworld.com, and I’ve summarized the top 5 features below:

ASP.Net 5 feature No. 1: Cross-platform runtime
ASP.Net 5 applications can be executed on either the full .Net CLR (Common Language Runtime) or the the new cross-platform .Net Core CLR runtime engine. The full .Net CLR is the default runtime engine that can provide compatibility with legacy applications. It runs only on the Windows operating system.

The .Net Core CLR is a lean, modular, and completely self-contained runtime that can be used to build lightweight and cloud-optimized Web applications. The Core CLR is cross-platform and open source, with ports for Windows, Linux, Mac OS X, and FreeBSD in the works. In short, you will now be able to build your application on one platform and execute it on another or even on multiple platforms.

ASP.Net 5 feature No. 2: Cloud-ready deployment

Thanks to the self-contained Core runtime, which can be deployed with your app, ASP.Net 5 is ready for the cloud. Diagnostics, session state, cache, and configuration will now work seamlessly both on premise and in the cloud. Further, multiple ASP.Net 5 apps can now be deployed side by side on the same host but configured and updated separately, because they no longer must share the same runtime. With ASP.Net 5 we now have a minimalistic .Net stack that is optimized for cloud and server workloads.

ASP.Net 5 feature No. 3: Unified core framework

One of the most fascinating of the new ASP.Net 5 features is the inclusion of a unified programming model for ASP.Net MVC, ASP.Net Web API, and ASP.Net Web Pages applications. Before ASP.Net 5, the MVC, Web API, and NetWeb Pages frameworks were implemented separately and hence contained certain inconsistencies and even conflicts.

The unified programming model means you can build applications that leverage MVC, Web API, and Web Pages without the need to reconcile differences in the three frameworks. You now have only one type of a controller to handle requests that are common to MVC, Web API, and Web Pages applications. In essence, you now have a single routing framework, a single model binding framework, and a one-filter pipeline.

ASP.Net 5 feature No. 4: Host agnosticism
ASP.Net is now host agnostic. It includes a new modular HTTP request pipeline that is optimized and can be hosted on any of the following platforms:

Internet Information Services (IIS)
OWIN (Open Web Interface for .Net)
Kestrel
Self-hosted in a custom process
Host agnosticism is a great new feature that not only eliminates the dependencies on the legacy System.Web namespace, but boosts application responsiveness to a considerable extent.

ASP.Net 5 applications don’t talk directly to the Web server. Rather, host agnosticism is facilitated through “feature interfaces” provided by theIApplicationBuilder interface. This enables ASP.Net 5 applications to switch between hosts seamlessly.

The OWIN standard defines an interface between Web servers and Web clients or Web applications. Katana is Microsoft’s OWIN implementation that additionally incorporates some middleware components. In essence, Kestrel is a cross-platform Web server from Microsoft that can be used with ASP.Net 5.

ASP.Net 5 feature No. 5: Improved performance
The ASP.Net 5 framework incorporates an optimized, modular pipeline that allows you to plug in only the components that your application needs. This pipeline is based on OWIN standards and incorporates most of the learnings from the Katana project. This runtime is no longer dependent on the System.Web assembly, reducing the overhead involved in serving HTTP requests and hence improving application throughput.

All in all, ASP.Net 5 is a significant improvement over previous versions, allowing developers to build modern cloud-based web apps using the existing .NET framework. Designed to minimize overhead by using modular and flexible components, it’s pretty cool! And the fact that’s it’s open sourced on GitHub is a real game changer, IMO. Believe it or not, the first version of ASP.NET was released 15 years ago, and has evolved significantly since then (like the rest of the web and the frameworks used to build it). The documentation for ASP.NET 5 is straight forward and easy to understand, with many examples cited for different use cases.

Having built for the web using a variety of different frameworks, it’s great to see that ASP is continuing to evolve, and that it’s still relevant in 2016. Microsoft may have fallen off the map for some of its previous flagship products, but I’m happy to say that ASP.NET won’t be one of them.