Show ASP.NET 5 error page in Azure web app Show ASP.NET 5 error page in Azure web app azure azure

Show ASP.NET 5 error page in Azure web app


In case this helps someone, I've found out that if you're using ASP.NET RC1 and you're using Azure WebApps and add an App setting called Hosting:Environment with a value of development a stack trace for server 500 errors will display.

enter image description here

For this to work the Configure method in the Startup.cs needs to use the Developer Exception page when you're using the Development environment. Eg:

public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) {    if (env.IsDevelopment())    {        app.UseDeveloperExceptionPage();        app.UseDatabaseErrorPage();    }    // etc}


According to this post (thanks Muhammad), I should be able to get the runtime error on Azure by editing the server's web.config (quite correct, Celt).

Unfortunately this did not work - no detailed exception.

I did some digging around and found these "DetailedError" logs:

DetailedErrors

This is what they contained:

HTTP Error 500.0 - Internal Server Error

It appears that something may have been going wrong when trying to resolve favicon.ico at D:\home\site\wwwroot\favicon.ico.

There indeed was no favicon at that location. I rectified this, but still the same problem. In fact, I have never had a favicon, and this used to work.

In the end, I deleted the entire Web App in Azure Portal and republished... TADA, it works again.


Try setting your customErrors mode to off in your Web.config file like this:

<system.web>  <customErrors mode="Off" /></system.web>