Practice question from Error Handling & Logging

What middleware method is used to register custom global exception handling in ASP.NET Core?

var app = builder.Build();
app.____(errorPath);

Answer

UseExceptionHandler

Explanation

UseExceptionHandler() is the built-in method for registering exception handling middleware. It takes a path or configuration delegate to handle exceptions globally.

More questions from ASP.NET with .NET 10