In the startup.cs code I do the following in the Configure method :
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
As a result, in my environment is not Development, when calling the API from Postman or even from a dedicated frontend, the error details are not returned.
However the environment variable ASPNETCORE_DETAILEDERRORS is set to true , so I would expect to receive details of the exception.
As a workaround, I had to create my own configuration setting and change the code to :
if (env.IsDevelopment() || Configuration["DetailedErrors"] == "true")
{
app.UseDeveloperExceptionPage();
}
Do I really need to do that or am I missing something ?
ASPNETCORE_DETAILEDERRORSonly affects startup errors. It doesn't, and isn't intended to, magically enable the developer exception page middleware.