Back to Practical Aspnetcore

Diagnostics (5)

projects/diagnostics/README.md

latest1.2 KB
Original Source

Diagnostics (5)

  • Welcome Page

    Simply show a welcome page to indicate that the app is working properly. This sample does not use a startup class simply because it's just a one line code.

  • Developer Exception Page

    Show any unhandled exception in a nicely formatted page with error details. Only use this in development environment!

  • Custom Global Exception Page

    Use IExceptionHandlerFeature feature provided by Microsoft.AspNetCore.Diagnostics.Abstractions to create custom global exception page.

  • Custom Global Exception Page - 2

    Similar to the previous one except that that we use the custom error page defined in separate path.

  • Status Pages

    Use UseStatusCodePagesWithRedirects. Beware: This extension method handles your 5xx return status code by redirecting it to a specific url. It will not handle your application exception in general (for this use UseExceptionHandler - check previous samples).

dotnet8