.net core 2.2 web应用程序:HTTP错误502.5 ANCM进程外启动失败。

问题描述 投票:0回答:1

当我使用FrameworkRuntime依赖模式将应用程序从Visual Studio部署到Azure应用程序服务时,应用程序服务运行正常。

但是,当应用程序部署使用CICD(使用VSTS),然后应用程序服务失败与上述错误的标题和以下错误被记录在stdout日志文件。

Error:
  An assembly specified in the application dependencies manifest (App.deps.json) was not found:
    package: 'System.Diagnostics.PerformanceCounter', version: '4.5.0'
    path: 'runtimes/win/lib/netcoreapp2.0/System.Diagnostics.PerformanceCounter.dll'

但dll存在于.netcoreapp2.0下的所述路径中。

我正在使用VSTS代理发布应用程序。

如果我重新启动应用程序服务,那么它工作正常。

.net-core azure-devops azure-pipelines azure-pipelines-release-pipeline .net-core-2.2
1个回答
0
投票

由于它工作正常时,你重新启动应用程序服务,你可以添加一个 Azure App Service manage 任务来重新启动管道中的 Azure App Service。

steps:
- task: AzureAppServiceManage@0
  displayName: 'Restart Azure App Service'
  inputs:
    azureSubscription: azureSubscriptionName
    Action: 'Restart Azure App Service'
    WebAppName: AppServiceName

0
投票

似乎你第一次尝试运行时,你的应用程序无法找到服务器上所需的这个.dll。你可以做的是在你的.csproj文件中添加这个。

<PropertyGroup>               
    <PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest>
</PropertyGroup>

添加上面的代码段将导出运行应用程序所需的所有DLLs(假设SDK不可用,并且运行时包含非必要的库是相当轻量级的)。


0
投票

这是个错误,可能会因为一千个不相关的原因而出现。 -每次我遇到这个错误,都是因为我在项目中升级了Nuget包,而其中一个包使用了我没有在本地安装的.Net Core SDK版本。 我猜想,由于你使用的是框架依赖模式,如果它将你从其他SDK的沙盒中分离出来,这可能是一个问题(不确定是否如此,只是大声思考)。

  • 确保你的.Net Core SDK是最新的。

  • 如果你使用.Net Core作为后端(而不是旧的框架),试着发布它并将整个框架一起发送。

  • 检查你的NuGet's并确保它们在你指定的框架上都得到支持。 我见过这样的情况:4.5框架的程序集 "可能 "在本地工作,但在服务器上出错。 如果其中一个程序集的目标是一个不在服务器上的SDK,你会得到这样的结果。

    https:/www.blakepell.comasp-net-core-http-error-502-5-ancm-out-of-process-startup-failure

© www.soinside.com 2019 - 2024. All rights reserved.