ASP.NET vNext – Whats in store…. Now ASP.NET Core


ASP.NET vNext (Core) has these new Features..

  • New flexible and cross-platform runtime
  • New modular HTTP request pipeline
  • Cloud-ready environment configuration
  • Unified programming model that combines MVC, Web API, and Web Pages
  • Ability to see changes without re-building the project
  • Side-by-side versioning of the .NET Framework
  • Ability to self-host or host on IIS
  • New tools in Visual Studio 2015

ALL ASP.NET Source code has been open sourced on Git Hub…
ASP.NET offers 3 runtimes

  • Full .NET CLR : Full .NET CLR is the default runtime for projects in Visual Studio. It provides the entire API set and is your best option for backwards compatibility.
  • Core CLR (cloud-optimized runtime) : The Core CLR is a lean and completely modular runtime for ASP.NET 5 projects. This CLR has been re-designed into components so you have the flexibility to include only those features that you need in your app. You add the components as NuGet packages. When you are finished, your app is dependent only on required features. By re-factoring the runtime into separate components, we can deliver improvements to the components more quickly because each component is updated on its own schedule. The Core CLR is about 11 megabytes instead of around 200 megabytes for the full .NET CLR. The Core CLR can be deployed with your app and different versions of the Core CLR can run side-by-side.
  • Cross-Platform CLR : Cross-platform runtime for Linux and Mac OS X. When released, this runtime will enable you to develop and run .NET apps on Mac and Linux devices.

Host anywhere : ASP.NET 5 enables you to host your app on IIS or self-host your app in your own process. When you target the Core CLR, you can deploy your app with every dependency bundled within the deployment package. Therefore, your app and its dependencies are completely self-contained and no longer dependent on a system installation of .NET.

Different versions of .NET side-by-side : When apps on a server depend on a single, system-wide installation of the .NET Framework, all of the apps have to run the same version of .NET. This situation might have created some anxiety for you when considering whether to upgrade to a new version of the .NET Framework. Perhaps, you wanted some of your apps to use the latest version of .NET but you were unsure whether all of your legacy apps would work appropriately with the new version. ASP.NET 5 fixes this problem. You can define the dependencies within your deployment package so you can specify for each app which version of .NET to use. You get the benefits of the latest version for some apps and the ease of sticking with an old version for other apps. All of these different versions run side-by-side without any problems. To run different versions side-by-side, you must target the Core CLR

Simplify dependency management: ASP.NET 5 introduces a new, lightweight way to manage dependencies in your projects. You no longer add assembly references to your project; instead, you manage dependencies by referencing NuGet packages. You can add NuGet packages through the NuGet Package Manager or you can edit the JSON file (project.json) that lists the NuGet packages and versions used in your project. To add other dependencies, you simply type the name and version number of the NuGet package into your project.json file. The project.json file only includes NuGet packages that you directly added to your project. If you add a NuGet package that is dependent on other packages, those secondary dependencies are loaded but not listed in the project.json file. This approach keeps your project.json file less cluttered and easier to manage. If you remove a NuGet package from project.json, the secondary dependencies are removed too if no other packages need them.

Eliminate duplication in MVC, Web API: MVC, Web API contained overlapping features but the implementations of those features were separate. For example, MVC and Web API both provided routing but the MVC routing classes resided in the System.Web.Mvc.Routing namespace while similar classes for Web API resided in the System.Web.Http.Routing namespace. Or, Web Pages and MVC both used Razor syntax, but some NuGet packages were compatible with only one or the other. In ASP.NET 5, MVC, Web API will be merged into a single framework called MVC 6. This merging removes duplication from the framework and makes it easier for you to develop apps that use these programming frameworks. You no longer need to write slightly different code depending on whether you are within an MVC, Web API, or Web Pages context.

New Modular HTTP pipeline : ASP.NET 5 introduces a new HTTP request pipeline that is lean and fast. This pipeline is modular so you can add only the components that you need. By reducing the overhead in the pipeline, app will experience better throughput. The new pipeline supports OWIN.

Integrate dependency injection : Dependency injection is built into ASP.NET 5. You can use your Inversion of Control (IoC) container to register dependencies. In ASP.NET vNext, dependency injection is a first class citizen. While in the previous versions of the framework, DI was partially supported, in ASP.NET vNext it is available throughout the entire stack. A minimalistic DI container is provided out of the box but we are leaving the door open to BYOC (Bring Your Own Container). The default container has minimal capabilities. BYOC is possible because of an abstraction over the actual DI container implementation. The abstraction is the IServiceProvider interface and it represents the least set of container behavior our components are limited to assuming are present. All the framework components (MVC, Routing, SignalR, Entity Framework, etc.) rely only on the capabilities of IServiceProvider, but your own application code can use any feature that your chosen DI container has. When you BYOC, you can replace the default implementation of IServiceProvider with a wrapper around your own container. Once that happens, all the dependency resolution calls will be routed to your own container. In the case when you want to use your own container strictly for your own custom types, we support fallback to our default container.The out of the box container supports the following lifestyles:

  • Instance: A specific instance is given all the time. You are responsible for its initial creation
  • Transient: A new instance is created every time
  • Singleton: A single instance is created and it acts like a singleton
  • Scoped: A single instance is created inside the current scope. It is equivalent to Singleton in the current scope

Per Request Scope : In ASP.NET vNext, the Per Request Scope is achieved using a middleware and a scoped lifestyle. The middleware, when invoked, will create a new scoped container which will replace the container for the current request. All the subsequent middleware in the pipeline will then utilize the scoped container. After the request flows through the pipeline and the container middleware is signaled to complete, the scope is destroyed and all the objects created inside it are disposed.

Web Forms : Web Forms 4.6 includes the following new features for Web Forms:

  • HTTP 2
  • Async model binding
  • Roslyn CodeDOM compilers

Existing Web Forms apps will continue to run without modification on IIS with .NET 4.6. You can’t use Web Forms apps with the cloud-optimized runtime.

Applications that you built on earlier versions of ASP.NET will continue to work with the new .NET Framework.


One thought on “ASP.NET vNext – Whats in store…. Now ASP.NET Core

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s