- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is Kestrel and how does it differ from IIS? (ASP.NET)
Kestrel is a lightweight, cross-platform, and open-source web server for ASP.NET Core. It is included and enabled by default in ASP.NET Core. Kestrel is supported on all platforms and versions supported by .NET Core.
In the Program class, the ConfigureWebHostDefaults() method configures Kestrel as the web server for the ASP.NET Core application.
public class Program{ public static void Main(string[] args){ CreateHostBuilder(args).Build().Run(); } public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) .ConfigureWebHostDefaults(webBuilder =>{ webBuilder.UseStartup<Startup>(); }); }
Though Kestrel can serve an ASP.NET Core application on its own, Microsoft recommends using it along with a reverse proxy such as Apache, IIS, or Nginx for better performance, security, and reliability.
The main difference between IIS and Kestrel is that Kestrel is a cross-platform server. It runs on Linux, Windows, and Mac, whereas IIS is Windows-specific.
Another essential difference between the two is that Kestrel is fully open-source, whereas IIS is closed-source and developed and maintained only by Microsoft.
IIS is an old, albeit powerful software. With Kestrel, Microsoft started with cross-platform and high performance as explicit design goals. Since the Kestrel codebase started from scratch, it allowed developers to ignore the legacy/compatibility issues and focus on speed and efficiency.
However, Kestrel doesn’t provide all the rich functionality of a full-fledged web server such as IIS, Nginx, or Apache. Hence, we typically use it as an application server, with one of the above servers acting as a reverse proxy.
- Related Articles
- What is a proton? How does it differ from a neutron?
- What is ASP.NET Core? Explain how it's different from the ASP.NET framework.
- How does Capital Gearing differ from Income Gearing?
- How does a Planet differ from a Star?
- How does a proton differ from an electron?
- How does an electron differ from a neutron?
- What is routing? Explain how it works in ASP.NET Core
- How does Implicit coercion differ from Explicit coercion in JavaScript?
- How does “void *” differ in C and C++?
- Knuckle-Buster – What is it and how does it work?
- Keynesian Put – What is it and how does it work?
- What is Bitcoin and how does it work?
- What is skeleton and how does it help?
- What is FTTP and how does it work?
- What is sonar and how does it work?
