The developer exception page

The MVC middleware of ASP.NET Core comes with a built-in developer exception page that is aimed at providing meaningful information while you're in development mode. When you created your ASP.NET Core project, Visual Studio automatically generated the code that enables the usage of the developer exception page inside the Configure method of the Startup class:

if (env.IsDevelopment()){    app.UseDeveloperExceptionPage();}
How does ASP.NET Core determine that you are in development mode? ASP.NET uses an environment variable by the name of ASPNETCORE_ENVIRONMENT. If its value is Development, then the IsDevelopment method returns true. You can control the value of the ASPNETCORE_ENVIRONMENT environment variable for each ...

Get Hands-On Full-Stack Web Development with ASP.NET Core now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.