首页 > 解决方案 > Azure appservice 返回错误 500.30,但我的应用在 kudu (ASP.NET Core) 上运行良好

问题描述

我最近从 .NET Core 3.1 迁移到 .NET 5。我还切换了我的应用服务设置并让它们使用 .NET 5 运行时。

然后我导航到应用程序 url,但收到 500.30 错误。为了诊断,我按照文档的建议执行了以下操作

但我的应用程序在 kudu 中运行良好。在应用程序事件日志中,我收到此错误:

物理根目录为“D:\home\site\wwwroot”的应用程序“/LM/W3SVC/1776254318/ROOT”无法加载 coreclr。
异常消息:CLR 工作线程过早退出
进程 ID:11956
。文件版本:15.0.20349.2。描述:IIS ASP.NET Core 模块 V2 请求处理程序。提交:2670c ...

根据文档,这可能是因为我在 64 位操作系统上运行 32 位应用程序。但是在检查了我的操作系统是 win-64 之后,我添加了 win 64 的 RID 并编译了我的应用程序。这仍然没有奏效。有人可以帮忙吗?

标签: c#azureasp.net-coreazure-web-app-service

解决方案


我发现我的构建管道 yml 没有以最有效的方式编写。通过管道构建和测试我的项目后,我没有正确发布它。我发布了解决方案:

- task: DotNetCoreCLI@2
  displayName: 'preparing artifact .zip to publish'
  inputs:
    command: publish
    publishWebProjects: False
    arguments: 'MyApp.sln --configuration $(buildConfiguration) --output $(Build.ArtifactStagingDirectory)'
    zipAfterPublish: True

而不是发布项目,这会导致部署问题。

- task: DotNetCoreCLI@2
  displayName: 'preparing artifact .zip to publish'
  inputs:
    command: publish
    publishWebProjects: False
    arguments: 'MyApp/MyApp.csproj --configuration $(buildConfiguration) --output $(Build.ArtifactStagingDirectory)'
    zipAfterPublish: True

推荐阅读