Cleaning up resources in .NET after use is essential to make efficient use of memory and avoid memory leaks. It is even more important when you are making use of unmanaged resources and cleaning up using dispose pattern is efficient than relying on finalization.
A series to explore all the builtin middlewares in ASP.NET 8. This post covers Developer Exception, and Status Code Pages Middleware, Exception Middleware and Exception Handlers.