ASP.Net MVC 6 - Whats New?

Asp.Net vNext (http://asp.net/vNext) is the official place where we learn about next generation of Microsoft's ASP.Net framework. As of 2014 vNext is MVC 6! Yes MVC 6 is the new cool major overhaul over previous ASP.Net. Recently, Microsoft announced the preview availability of this product.

ASP.NET vNext is a lean and composable framework for building web and cloud applications. ASP.NET vNext is fully open source and available on GitHub.

MVC 6  has been redesigned from the ground up. The goal is to create a lean and composable .NET stack for building modern web/cloud-based apps. Microsoft has chosen a new direction, where the Web API, MVC and Web Pages framework are merged into one framework. This allows to remove a lot of the overlap between the three frameworks. And result of this change means that MVC can be self-hosting just like Web API.

Yes, System.Web is very heavy & quite expensive! A typical HttpContext object graph would consume about 30K of memory per request. With MVC 6's new design, its independent of System.Web now and the pre-request overhead drops to roughly 2K.

 [stextbox id="black"]MVC, Web API, and Web Pages are merged into one framework, called MVC 6.[/stextbox]

Here are the highlights:

Rebuilt from the Ground Up

  • MVC, Web API, and Web Pages are merged into one framework, called MVC 6. The new framework uses a common set of abstractions for routing, action selection, filters, model binding, and so on.
  • Dependency injection is built into the framework. Use your preferred IoC container to register dependencies.
  • vNext is host agnostic. You can host your app in IIS, or self-host in a custom process. (Web API 2 and SignalR 2 already support self-hosting; vNext brings this same capability to MVC.)
  • vNext is open source and cross platform.

Leaner, Faster

  • MVC 6 has no dependency on System.Web.dll. The result is a leaner framework, with faster startup time and lower memory consumption.
  • vNext apps can use a cloud-optimized runtime and subset of the .NET Framework. This subset of the framework is about 11 megabytes in size compared to 200 megabytes for the full framework, and is composed of a collection of NuGet packages.
  • Because the cloud-optimized framework is a collection of NuGet packages, your app can include only the packages you actually need. No unnecessary memory, disk space, loading time, etc.
  • Microsoft can deliver updates to the framework on a faster cadence, because each part can be updated independently.

True Side-by-Side Deployment

The reduced footprint of the cloud-optimized runtime makes it practical to deploy the framework with your app.

  • You can run apps side-by-side with different versions of the framework on the same server.
  • Your apps are insulated from framework changes on the server.
  • You can make framework updates for each app on its own schedule.
  • No errors when you deploy to production resulting from a mismatch between the framework patch level on the development machine and the production server.

New Development Experience

vNext uses the Roslyn compiler to compile code dynamically.

  • You can edit a code file, refresh the browser, and see the changes without rebuilding the project.
  • Besides streamlining the development process, dynamic code compilation enables development scenarios that were not possible before, such as editing code on the server using Visual Studio Online ("Monaco").
  • You can choose your own editors and tools.

Resources

  • Getting Started with ASP.NET vNext and Visual Studio "14"

    By Tom Dykstra and Mike Wasson|

    An introduction to Visual Studio features for developing ASP.NET vNext applications. Walks you through creating a vNext project and deploying it to Azure.

  • ASP.NET vNext in Visual Studio “14” CTP

    Blog post with a comprehensive introduction to ASP.NET vNext. Includes an overview of features, a walkthrough showing how to use vNext in Visual Studio and from the command line, frequently asked questions, and links to additional resources.

  • Getting Started with ASP.NET MVC 6

    By Mike Wasson|

    An overview of the new ASP.NET MVC 6 framework, which unifies MVC, Web API, and Web Pages.