Kestrel is the default web server used in ASP.NET Core, and it's designed to be lightweight, high-performance, and cross-platform. It is typically sufficient for development, testing, and running production workloads when paired with a reverse proxy like Nginx or Apache in production environments. However, it is essential to understand the strengths and weaknesses of Kestrel in contrast to IISExpress.
One of the main points of confusion might come from the fact that IISExpress is a simplified version of IIS (Internet Information Services), designed for development and debugging purposes. It is integrated tightly into the Visual Studio ecosystem, offering a simplified way to host and test ASP.NET Core applications without requiring the full IIS setup. However, it's important to note that IISExpress is not a replacement for Kestrel in production. It’s a development tool.
Kestrel, on the other hand, is much more robust and powerful when used correctly. It's built for high-performance, multi-threaded, asynchronous handling of web requests and can support complex, production-grade scenarios. It's also cross-platform, which means it works on Windows, Linux, and macOS, giving ASP.NET Core applications a wider deployment footprint compared to IISExpress, which is specifically a Windows-based development tool.
As for performance, Kestrel is generally faster and more scalable than IISExpress, primarily because it is lightweight and optimized for modern web workloads. While IISExpress may seem more "comfortable" in the Visual Studio experience due to its IIS-like setup, it doesn't offer the same raw performance or the flexibility that Kestrel provides. Additionally, Kestrel is capable of running applications directly without needing a reverse proxy, but in a production environment, it is often recommended to place Kestrel behind a reverse proxy like Nginx or Apache for added security and scalability.
From a development perspective, Kestrel can handle HTTPS, reverse proxying, and load balancing directly, and it can integrate with other tools and libraries used in ASP.NET Core applications. So, unless you are developing something that explicitly requires features that IISExpress provides, Kestrel will likely be more than sufficient.
If your colleague has such a strong opinion against Kestrel, they might be conflating the use of IIS in production with IISExpress in development. IIS is indeed more feature-rich than Kestrel (due to additional enterprise-level capabilities like process management, built-in authentication, and advanced logging), but that doesn’t mean IISExpress is necessary for development in ASP.NET Core. Kestrel is a better choice when it comes to working with modern, cross-platform web apps.
If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.
hth
Marcin