What is the difference between a Middleware and a HttpModule?
- A HttpModule is core to the ASP.NET MVC framework, while a Middleware is native to the ASP.NET Core
- Both Middleware and HttpModule are pieces of code blocks which lets two or more components interact together during a request execution.
- HttpModules are registered in the web.config file of the ASP.NET framework while a Middleware is registered via code inside an ASP.NET Core application.
- The order of execution of HttpModules can't be changed, while since the middlewares are wired programmatically within the code, their order or execution can be altered or skipped when needed.
Posted Feb 22, 2021