Search code examples
asp.net-coreowin.net-corekestrel-http-server

Details needed to clarify info from official asp.net site


I am studying Asp.Net Core. and honestly I am little confused.

On official website it says:

ASP.NET Core is completely decoupled from the web server environment that hosts the application

What does it mean? does it mean asp.net Core apps can be hosted on any server that accepts http traffic and respond to it, I get this notion from following line

ASP.NET Core supports hosting in IIS and IIS Express, and self-hosting scenarios using the Kestrel and WebListener HTTP servers

from the above quote: what is Kestrel and WebListener HTTP servers? Does that mean apache tomcat can also host asp.net core apps and if it can then what I will need after installing apache?

and the last thing I am wondering is this

Additionally, developers and third party software vendors can create custom servers to host their ASP.NET Core apps.

how can one create custom servers to host asp.net core apps. does this referring to self hosted apps using OWIN?


Solution

  • apps are basically self hosted by default, basically a console app that internally runs kestrel web server. When they say it is decoupled from a web server what they mean is older ASP.NET apps were tightly coupled to IIS, and the new ASP.NET Core is decoupled from that. To see the bare bones of it look at this sample and see how Program.cs is like a console app that would be called by dotnet command, ie dotnet run and it configures how things are hosted and what the startup class is.

    currently, kestrel is not meant to be an internet facing web server, there is a module to run it behind IIS and there are tutorials out there about running it proxied behind nginx. Should also be possible to do this with apache but not sure if there is a module existing for it yet or if one is needed

    kestrel is cross platform and used by default, weblistener can be used instead of kestrel but I "think" that is windows only

    I'm not sure if we still call it OWIN anymore but something very the same as OWIN is how we configure the middleware pipeline from the startup class