ASP.NET Core hosting

Hosting is how you get you ASP.NET application up and running. And ASP.NET Core is just bunch of libraries host in you own process. It’s not provide a hosting – user have to take care of providing hosting process.

That gives us lot of possibilities and flexibility. Such application can be hosted in console application, windows service or everywhere you want – all you need to do is to build a host, get it started and start listening for requests. Bellow I will try to show you couple of examples of that.

Build the host

In few words all we need to do is to:

Setup host services – definition of the features which you server will provide

Build the app RequestDelagate – host will take the request pipeline logic defined in the startup logic and turn it into the Request Delegate. Request Delegate is the core abstraction of ASP.NET Core – it take the HTTP request and does something asynchronously with it.