ASP.NET Core 6.0 Features

Last Updated: 5/27/2022

Developer Exception Page Middleware Changes

Overview

  • Developer exception page middleware catches unhandled exceptions in the request pipeline and displays detailed information about the exception
  • It runs early in the middleware pipeline and catches exception throws in the middleware that follows.
  • For security reasons, detailed exception information shouldn't be displayed when the app runs in the Production environment.
  • Developer Exception Page can include the following information about the exception and the request:
    • Stack trace
    • Query string parameters, if any
    • Cookies, if any
    • Headers

Adding Developer Exception Page Middleware

From ASP.NET Core 6.0 - Default Added

From ASP.NET Core 6.0, web apps add the developer exception page by default when running in the Development environment.

Older Version

if (app.Environment.IsDevelopment())
{
    app.UseDeveloperExceptionPage();
}