Home > ASP.NET > ASP.NET Core – 2016

ASP.NET Core – 2016

ASP.NET 5 is no longer based on System.Web.dll, but is instead based on a set of granular and well factored NuGet packages allowing you to optimize your app to have just what you need. You can reduce the surface area of your application to improve security, reduce your servicing burden and also to improve performance in a true pay-for-what-you-use model.


ASP.NET 5 is built with the needs of modern Web applications in mind, including a unified story for building Web UI and Web APIs that integrate with today’s modern client-side frameworks and development workflows. ASP.NET 5 is also built to be cloud-ready by introducing environment-based configuration and by providing built-in dependency injection support.


In summary, with ASP.NET 5 you gain the following foundational improvements:

New light-weight and modular HTTP request pipeline
Ability to host on IIS or self-host in your own process
Built on .NET Core, which supports true side-by-side app versioning
Ships entirely as NuGet packages
Integrated support for creating and using NuGet packages
Single aligned web stack for Web UI and Web APIs
Cloud-ready environment-based configuration
Built-in support for dependency injection
New tooling that simplifies modern web development
Build and run cross-platform ASP.NET apps on Windows, Mac and Linux
Open source and community focused


ASP.NET 5 applications are built and run using the new .NET Execution Environment (DNX). Every ASP.NET 5 project is a DNX project. ASP.NET 5 integrates with DNX through the ASP.NET Application Hosting package.

ASP.NET 5 applications are defined using a public Startup class:

public class Startup
     public void ConfigureServices(IServiceCollection services)

     public void Configure(IApplicationBuilder app)

     public static void Main(string[] args) => WebApplication.Run<Startup>(args);

The ConfigureServices method defines the services used by your application and the Configure method is used to define what middleware makes up your request pipeline. See Understanding ASP.NET 5 Web Apps for more details.


A service is a component that is intended for common consumption in an application. Services are made available through dependency injection. ASP.NET 5 includes a simple built-in inversion of control (IoC) container that supports constructor injection by default, but can be easily replaced with your IoC container of choice. See Dependency Injection for more details.

Services in ASP.NET 5 come in three varieties: singleton, scoped and transient. Transient services are created each time they’re requested from the container. Scoped services are created only if they don’t already exist in the current scope. For Web applications, a container scope is created for each request, so you can think of scoped services as per request. Singleton services are only ever created once.


In ASP.NET 5 you compose your request pipeline using Middleware. ASP.NET 5 middleware perform asynchronous logic on an HttpContext and then optionally invoke the next middleware in the sequence or terminate the request directly. You generally “Use” middleware by invoking a corresponding extension method on the IApplicationBuilder in your Configure method.

ASP.NET 5 comes with a rich set of prebuilt middleware:

Working with Static Files
You can also author your own custom middleware.

You can use any OWIN-based middleware with ASP.NET 5. See OWIN for details.


The ASP.NET Application Hosting model does not directly listen for requests, but instead relies on an HTTP server implementation to surface the request to the application as a set of feature interfaces that can be composed into an HttpContext.

ASP.NET 5 includes server support for running on IIS or self-hosting in your own process. On Windows you can host your application outside of IIS using the WebListener server, which is based on HTTP.sys. You can also host your application on a non-Windows environment using the cross-platform Kestrel web server.

Web root

The Web root of your application is the root location in your project from which HTTP requests are handled (ex. handling of static file requests). The Web root of an ASP.NET 5 application is configured using the “webroot” property in your project.json file.


ASP.NET 5 uses a new configuration model for handling of simple name-value pairs that is not based on System.Configuration or web.config. This new configuration model pulls from an ordered set of configuration providers. The built-in configuration providers support a variety of file formats (XML, JSON, INI) and also environment variables to enable environment-based configuration. You can also write your own custom configuration providers. Environments, like Development and Production, are a first-class notion in ASP.NET 5 and can also be set up using environment variables:

  var builder = new ConfigurationBuilder()
    .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true);

if (env.IsDevelopment())
    // For more details on using the user secret store see http://go.microsoft.com/fwlink/?LinkID=532709

Configuration = builder.Build();

See Configuration for more details on the new configuration system and Working with Multiple Environments for details on how to work with environments in ASP.NET 5.

Client-side development¶ASP.NET 5 is designed to integrate seamlessly with a variety of client-side frameworks, including AngularJS, KnockoutJS and Bootstrap. See Client-Side Development for more details



Categories: ASP.NET
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: