We’ve discussed the IApplicationBuilder
interface and how it provides the built-in methods used to configure the middleware pipeline. Now, let’s dive deeper into some of the more commonly used built-in methods and explore their functionality. We’ll start with UseDeveloperExceptionPage()
.
UseDeveloperExceptionPage()
is a method which provides an exception page specifically designed for developers. While developers are working on the web application, they need to be able to see detailed information about any exceptions that may be thrown. This detailed information can help the developer write better code so the end user can avoid the exception.
The method should be placed before any middleware components that are catching exceptions. Some of the information displayed includes the stack trace, any query string parameters, cookies, headers, and routing information.
Instructions
Review the developer exception page. Note how the data displayed gives detailed information about the exception and the code.