如何获取Azure Web App的错误500的详细信息? [英] How do I get the details of an Error 500 for an Azure Web App?

查看:95
本文介绍了如何获取Azure Web App的错误500的详细信息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个已部署为Azure Web App的MVC 6站点.我已使用服务器资源管理器在Visual Studio中启用了所有跟踪/诊断选项.我正在尝试进行远程调试,但是我在浏览器中仅看到Error 500,而没有找到关于错误发生的确切位置的任何信息(或触发错误断点).

I have an MVC 6 site that has been deployed as an Azure Web App. I have enabled all tracing / diagnostic options in Visual Studio using Server Explorer. I am trying to do remote debugging, but I am only seeing an Error 500 on my browser, and not finding any information (or triggering an error breakpoint) on where exactly the error occurred.

我从Azure获得的文件日志中找不到任何错误跟踪.

I can't find any error trace on the file logs that I get from Azure.

我应该如何对Azure Web应用程序中的错误500进行故障排除?

How should I troubleshoot Error 500's in an Azure Web App?

向config.json添加"CustomErrors":{"Mode":"Off"}无效.

Adding "CustomErrors": {"Mode": "Off"} to config.json didn't work.

推荐答案

对于MVC 6,您需要使用以下命令将一个web.config文件添加到wwwroot文件夹中:

For MVC 6 you need to add a web.config file to the wwwroot folder with the following:

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

这会将标记添加到已部署的web.config文件中,并为您提供详细的错误.请参阅 http://docs.asp.详情请访问net/zh-CN/latest/fundamentals/diagnostics.html#http-500-errors-on-azure .

That will add the markup to the deployed web.config file, and give you detailed errors. See http://docs.asp.net/en/latest/fundamentals/diagnostics.html#http-500-errors-on-azure for more details.

这篇关于如何获取Azure Web App的错误500的详细信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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