I'm hosting an ASP.NET Core app in a Windows Azure Web Site. I'm wondering how to get details of an exception occuring in the Startup.Configure() method? All I see is An error occurred while starting the application..
One thing that DOES work is adding an app setting of ASPNETCORE_ENVIRONMENT="Development".
Then I get System.Exception... at X.Startup.Configure() as expected.
But this is not a feasible solution. Azure is my Staging environment, and I'm already using the environment concept to substitute my connection strings (as suggested in almost every ASP.NET Core documentation I have ever read).
Things I have tried without any effect:
Adding
app.UseDeveloperExceptionPage()(not surrounded by anyifstatement).Adding
<customErrors mode="Off"/>to Web.config, as suggested here https://stackoverflow.com/a/29539669/268091Adding
ASPNET_DETAILED_ERRORS="true"to Web.config, as suggested here https://stackoverflow.com/a/32094245/268091Enabling
Detailed error messagesin Azure portal /Diagnostics logsAdding a
try-catch, writing a manual response, as suggested here https://stackoverflow.com/a/29524042/268091Deleting everything and redeploying.
Is there really no other way to achieve this, than hijacking the environment concept altogether?