简体   繁体   English

Azure ASP.NET Core-新文件错误500

[英]Azure ASP.NET Core - Error 500 for new files

I'm developing an ASP.NET Core application and use Azure as Cloud server. 我正在开发ASP.NET Core应用程序,并将Azure用作云服务器。

Since yesterday all was working good, but I push to preproduction a new version of my application, and boom... 从昨天开始,一切运行良好,但是我推动了我的应用程序的新版本的预生产,并且蓬勃发展...

When I try to acceed to my new webapi controller , I have a Internal 500 error. 当我尝试使用新的webapi控制器时,出现内部500错误。 This is the log that I donwload from Kudu : 这是我从Kudu下载的日志:

在此处输入图片说明

My controller is very basic, and the most strange is that older controller keep running 我的控制器非常基础,最奇怪的是较旧的控制器继续运行

EDIT 编辑

The issue comes from a folder with an cshtml file that are not correclty publish to the azure website. 该问题来自带有cshtml文件的文件夹,该文件夹没有正确发布到azure网站。

This file is use to create a email from an HTML Template, and when I use the Service that call this HTML template it throw an error. 此文件用于从HTML模板创建电子邮件,当我使用调用此HTML模板的服务时,它将引发错误。

I tried to add in my csproj 我尝试添加csproj

<None Include="$(ProjectDir)/EmailTemplates/OrderCompleteEmail.cshtml" CopyToOutputDirectory="Always" />

but still not uploaded to azure... Any idea 但仍未上传到天蓝色...任何想法

I would suggest to turn on Logging: 我建议打开日志记录:

  • Go to the Kudu console (https://.scm.azurewebsites.net) 转到Kudu控制台(https://.scm.azurewebsites.net)
  • select Debug console -> PowerShell 选择调试控制台-> PowerShell
  • Navigate to site -> wwwroot and open the web.config file 导航到站点-> wwwroot并打开web.config文件
  • Set the stdoutLogEnabled attribute to true and save the config. 将stdoutLogEnabled属性设置为true并保存配置。

Now, you have to create a folder named "logs" in the wwwroot directory and restart your app. 现在,您必须在wwwroot目录中创建一个名为“ logs”的文件夹,然后重新启动您的应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM