如何排除故障"内部服务器错误"在Azure MVC6 Beta8应用程序?

时间:2015-10-16 07:45:37

标签: azure azure-web-sites asp.net-core-mvc

我有一个可在本地运行的MVC6 Beta8应用程序。但是,当我将其发布到Azure并打开主页时,它将返回错误500"由于发生了内部服务器错误,因此无法显示页面。"。

我启用日志,但只能看到kudu日志和http原始日志

2015-10-16 07:38:48 RENT-A-BIKE GET / X-ARR-LOG-ID=3c27af78-3874-4482-ac68-db29581070c1 80 - 112.207.250.32 Mozilla/5.0+(Windows+NT+10.0;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/46.0.2490.71+Safari/537.36 .AspNet.Microsoft.AspNet.Identity.Application=CfDJ8HSojZD46JRKpzcRvF66TcKzVHMrCLJRTTbz0MjK8rYaNUpfZzWwtz9EclfXXiMRUJ86IxNB_tWT5UhG03TptxP2tAXaedN0W1bQsMPhoeZR_OUrN5T0JeKZ8YAyqQkSfMmJo2rSphQFPfor7ztnbhs7vXaL0tYmsdflHAaRJH0nWs05vWuDfBkVnf7VofdoK5pICbz_QZ-HyNiH1dBzbl7CKvnzrpU7Erz4_hM4FPpAgY3hVRSuLuSYq8s9xnFNeLXI52u0DUU7GTwNYXZ946_wvjnIx706R6m4rh1c4__fLDNR6x2kPPHwWzKyftbhI3ETToJjAVtmNglY0WG9hCfZvZ_V_iCPWNmowfeU3YZ2Ux1lcDaHzr9o1o0T5ounqTzMqs_HzflN08-o7-xYF7BaqTOSjuScIWdpYDpXdzi7GAP3Hm7JPC3BG4A2GCoMjJpPDMDz6Aof9P0Td0EFB6XafDtduMewIZxf8-bGykUqoCgCb2i0dO21PFU-qkcg9kJ0LCm0kGdLERsEFLy4_a2X5vEBiyWIAlYu1JCb95l0FW87TcsMe1HwvsvubS4OkyIcKEo4UyX61AGPoRbf8OjXVvzYedG53mYdFVwsp2UARwmkGOqalp2ljGXYNCFtFkHc84ggj6XAvnnnvDCJDRAzABsNxm-b8mXtFEhgBKdzpS8Yn0egmHQNhDGP-hJy2hF-QJl8LnxjEpXg4yFtUaod54Y1_mopW11rkoWdz6aM4prIOf09TrG4NL4Y_1Ohgw;+_ga=GA1.3.68280290.1444933317;+ARRAffinity=e3c351936b5fcfb74e537a7dc58aebd6a3183747ae4ea853fe04b8e76e10ac5d - rent-a-bike.azurewebsites.net 500 19 183 466 1727 251
2015-10-16 07:38:48 RENT-A-BIKE GET /favicon.ico X-ARR-LOG-ID=5aaf9cc0-3594-4751-8571-197cc8465cef 80 - 112.207.250.32 Mozilla/5.0+(Windows+NT+10.0;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/46.0.2490.71+Safari/537.36 .AspNet.Microsoft.AspNet.Identity.Application=CfDJ8HSojZD46JRKpzcRvF66TcKzVHMrCLJRTTbz0MjK8rYaNUpfZzWwtz9EclfXXiMRUJ86IxNB_tWT5UhG03TptxP2tAXaedN0W1bQsMPhoeZR_OUrN5T0JeKZ8YAyqQkSfMmJo2rSphQFPfor7ztnbhs7vXaL0tYmsdflHAaRJH0nWs05vWuDfBkVnf7VofdoK5pICbz_QZ-HyNiH1dBzbl7CKvnzrpU7Erz4_hM4FPpAgY3hVRSuLuSYq8s9xnFNeLXI52u0DUU7GTwNYXZ946_wvjnIx706R6m4rh1c4__fLDNR6x2kPPHwWzKyftbhI3ETToJjAVtmNglY0WG9hCfZvZ_V_iCPWNmowfeU3YZ2Ux1lcDaHzr9o1o0T5ounqTzMqs_HzflN08-o7-xYF7BaqTOSjuScIWdpYDpXdzi7GAP3Hm7JPC3BG4A2GCoMjJpPDMDz6Aof9P0Td0EFB6XafDtduMewIZxf8-bGykUqoCgCb2i0dO21PFU-qkcg9kJ0LCm0kGdLERsEFLy4_a2X5vEBiyWIAlYu1JCb95l0FW87TcsMe1HwvsvubS4OkyIcKEo4UyX61AGPoRbf8OjXVvzYedG53mYdFVwsp2UARwmkGOqalp2ljGXYNCFtFkHc84ggj6XAvnnnvDCJDRAzABsNxm-b8mXtFEhgBKdzpS8Yn0egmHQNhDGP-hJy2hF-QJl8LnxjEpXg4yFtUaod54Y1_mopW11rkoWdz6aM4prIOf09TrG4NL4Y_1Ohgw;+_ga=GA1.3.68280290.1444933317;+ARRAffinity=e3c351936b5fcfb74e537a7dc58aebd6a3183747ae4ea853fe04b8e76e10ac5d http://rent-a-bike.azurewebsites.net/ rent-a-bike.azurewebsites.net 500 19 183 466 1696 31

我还尝试在web.config中禁用自定义错误,但它不起作用(据我所知,从Beta8开始不适用)。

如何解决此问题以查看发生的实际错误?

3 个答案:

答案 0 :(得分:0)

我启用"详细错误消息"是Azure Web应用程序配置,我能够看到日志文件目录中的DetailedErrors文件夹,其中包含许多带有错误详细信息的.html文件。

答案 1 :(得分:0)

因为详细错误开始出现在Log Files目录的DetailedErrors文件夹中 - 在Azure中重新启动应用程序。

答案 2 :(得分:0)

project.json文件中,对于web命令,请指定环境参数= development

"commands": {
    "web": "Microsoft.AspNet.Server.Kestrel --ASPNET_ENV development",
  }

Startup.cs文件中,在配置中你应该:

if (env.IsDevelopment())
            {
                app.UseBrowserLink();
                app.UseDeveloperExceptionPage();
                app.UseDatabaseErrorPage();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
            }

这意味着当您在开发的其他托管环境中运行时,Error page将显示为DeveloperExceptionPage