Hosting is the process that is used to run your ASP.NET Core application. In ASP.NET Core, you have two out-of-the-box hosting choices:
- Kestrel: The cross-platform host, which is set by default
- HTTP.sys (WebListener in ASP.NET Core pre-2.x): A Windows-only host
If you want your application to run on different platforms, not just on Windows, then Kestrel should be your choice, but if you need to target only Windows, then WebListener/HTTP.sys may offer better performance, as it utilizes native Windows system calls. You have to make this choice. By default, the Visual Studio template (or the ones used by the dotnet command) uses Kestrel, which is appropriate for most common scenarios. Let's learn about how we can choose what's best for our purposes.
Choosing the best host
You should compare the two hosts to see how well they behave in stressful situations. Kestrel is the default one and is...