This is a security measure used in production mode so that any user does not receive confidential information about exceptions from our application.
You can change ASPNETCORE_ENVIRONMENT from Production to Development.
Another option is to change the Configure () method code in Startup.cs. It is this method that does the check:
public void Configure(IApplicationBuilder app, IHostingEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler("/Error"); } ... }
This is not recommended, but you can eliminate this condition:
public void Configure(IApplicationBuilder app, IHostingEnvironment env) { app.UseDeveloperExceptionPage(); ... }
source share