What's new in ASP.NET MVC 6

ASP.NET MVC 6 is built on top of ASP.NET Core 1.0 and it's MVC and Web API combined into one single package.

ASP.NET Core 1.0 is the latest version of the web framework from Microsoft built on top of the new .Net Core framework. It was earlier known as ASP.NET 5 but was changed lately to ASP.NET core. The naming caused a lot of confusion among the developer community with existence of ASP.NET 4.6 version. Since ASP.NET 5 is completely new and built from scratch, giving the version as 5 was little bit off also. This version of the framework has undergone significant changes to the architecture and now it's open source also. 

Pic Courteousy : Scot Hanselman's blog

As you can see from the diagram, there are two libraries built on top of Compilers an Runtime Components. First one is the .NET framework library which is the full package and .NET 4.6 framework runs on top of it and is targeted for Windows platform. Next one is .NET core libraries is cloud optimized modular framework which can run on Mac, Linux and Windows and it's Open Source also. Since .NET Framework 4.6 has got the full package ASP.NET Core 1.0 apps targeting Windows will be able to run on it also. 

.NET framework library is a big monolithic package which containes the runtime, all the base class libraries and get installed in a central location so that evey apps targeting the framework can easily access it. But when I creates an application I am not going to use all of these features but only a subset of it and there is option for opt-out . So basicaly we wasting precious system resources on things which are not used.

This is where ASP.NET Core comes into picture. Since it's designed as a completely modular thing, we have the option to opt-in which all features are needed there by reducing the memory footprint. Every component is available as packages which can be pulled in by package manager applications like nuGet and ship it with your distribution. This way you will have the complete control over dependencies and you can make updates to the packages as wish and without disturbing the centralized version.

Normaly when we compile C#/VB code in .NET, it's first converted to IL(Intermediate Lanaguage) and then it's converted to native code during runtime. This process is called Just In Time compilation or JIT ing. But this process is not ideal for mobile or small form factor devices where system resources are a premium. In ASP.NET Core 1.0 introduces a new tool chain called .NET Native focussed on compiling IL code to native code and the process is termed as Ahead Of Time or AOT compilation.

As I mentioned earlier in the post, MVC and Web API is a unified framework, that we means we can send back the razor data and content negotiated data from the same controller using the same pipeline. Some of the new features of MVC 6 are

  1. Tag Helpers
  2. Dynamic Development
  3. Inegration with Bower, Grunt and Gulp
  4. Enhanced Dependency Management
  5. DI Enhancements
  6. Cloud-ready Configuration
  7. OWIN Support
  8. Project Solution Changes
  9. Hosting Improvements
  10. Framework Targeting

So in coming post in this series, I will be detailing more about each of the features mentioned above.

Till then, Happy Coding

No Comments

Add a Comment