How to Get Error Details of an ASP.NET 5 app deployed on Azure Websites?

后端 未结 10 1938
执笔经年
执笔经年 2020-12-05 02:23

I have an ASP.NET 5 solution with a website and several project libraries. I\'m using MVC 6 and Entity Framework 7. Locally the app is working fine and until today it was wo

10条回答
  •  孤街浪徒
    2020-12-05 02:34

    In RC1 (as of beta8, perhaps), one should apparently use:

    app.UseDeveloperExceptionPage();
    

    .. which apparently only works if app.Properties["host.AppMode"] is "development".

    But this didn't work for me. The error message I was getting was specifically "An error occurred while starting the application", I have found that none of the given configurations will resolve this because the error is occurring before the configurations execute.

    Somehow, the publish target folder must have gotten corrupted during publish because I found that deleting the entire deployment directory and re-publishing resolved the problem.

    Otherwise, here is the reference: http://docs.asp.net/en/latest/fundamentals/diagnostics.html https://docs.microsoft.com/en-us/aspnet/core/fundamentals/error-handling

提交回复
热议问题