如何获取一个ASP.NET应用程序5部署在Azure网站的错误详细信息? [英] How to Get Error Details of an ASP.NET 5 app deployed on Azure Websites?

查看:264
本文介绍了如何获取一个ASP.NET应用程序5部署在Azure网站的错误详细信息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网站,几个项目库的ASP.NET 5解决方案。我使用MVC 6和Entity Framework 7.在本地的应用程序工作正常,直到今天,它也正在Azure上部署为Azure的网站。

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 working also on Azure deployed as an Azure Website.

但今天在Azure上最新的部署后,我的启动得到了这样的错误500(还是做工精细本地):

But today after the latest deployment on Azure I got an error 500 like this on the startup (still working fine locally):

我试图得到更多的细节:

I tried to get more details by :


  • 使用中间件诊断

  • 在web.config文件中添加customError / HTTPError这样的设置

  • 下载所产生的网页DetailedError

似乎错误/异常时启动/配置的步骤发生,但我仍然得到一般性的错误页面没有细节。即使在服务器(DetailedErrors文件夹)中产生的版本,我得到这样的:

It seems that the error/exception is happening during the Startup/Configure step but I'm still getting the generic error page without details. Even the version generated on the server (DetailedErrors folder) I got this:

我启用了失败请求跟踪,但仍然没有有用的信息:

I enabled the Failed Request Tracing but still no useful information:

即使我剥离下来的启动/配置code,并添加一个try / catch的建议,我得到了同样的错误,而不细节。这似乎是一个配置/编译问题,但很难不带任何信息进行调试。

Even if I strip down the code in the Startup/Configure and add a try/catch as suggested I got the same error without détails. It seems to be a configuration/compilation issue but hard to debug without any information.

推荐答案

在RC1(如beta8,也许),应该使用显然是:

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

app.UseDeveloperExceptionPage();

..这显然只工作,如果 app.Properties [host.AppMode] 发展

但是,这并没有为我工作。我得到的错误信息是明确的,同时启动应用程序时出现错误的,我发现,没有任何给定的配置将解决这一点,因为配置执行前的错误发生。

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.

另外,这里是参考:<一href=\"http://docs.asp.net/en/latest/fundamentals/diagnostics.html\">http://docs.asp.net/en/latest/fundamentals/diagnostics.html

这篇关于如何获取一个ASP.NET应用程序5部署在Azure网站的错误详细信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆