本文介绍了Azure webapp 502.5错误,出现在任何地方的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Azure上托管一个网站,过去几个月一直运行良好.我正在使用用于CI的devops构建/发布管道,效果也很好.

I'm hosting a website on Azure, and it's been working fine for the past few months. I'm using a devops build/release pipeline for CI, which works great as well.

今天早上,我的网站出现502.5错误-处理失败,没有任何最新更改或提交了解决方案.

This morning, my website went down with a 502.5 error - Process Failure without any recent changes or commits to the solution.

我尝试过重新启动它,尝试通过Azure调试它.

I've tried restarting it, I've tried debugging it through Azure.

我最终尝试在Azure的控制台中使用dotnet.[此处为应用程序名称],这产生了以下错误:

I ended up trying to use dotnet .[app name here] in the console in Azure, which gave the following error:

未处理的异常:System.IO.FileLoadException:无法加载文件或程序集'Microsoft.AspNetCore.Server.IISIntegration,版本= 2.1.7.0,区域性=中性,PublicKeyToken = adb9793829ddae60'.找到的程序集的清单定义与 程序集参考. (位于D:\ a \ 1 \ s \ InventoryManagementGalten \ Program.cs:line中位于Microsoft.AspNetCore.WebHost.CreateDefaultBuilder(String [] args)位于InventoryManagementGalten.Program.CreateWebHostBuilder(String [] args)处的Microsoft.AspNetCore.WebHost.CreateDefaultBuilder(String [] args) 14点 D:\ a \ 1 \ s \ InventoryManagementGalten \ Program.cs:line 10中的InventoryManagementGalten.Program.Main(String [] args)

Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'Microsoft.AspNetCore.Server.IISIntegration, Version=2.1.7.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) at Microsoft.AspNetCore.WebHost.CreateDefaultBuilder(String[] args) at InventoryManagementGalten.Program.CreateWebHostBuilder(String[] args) in D:\a\1\s\InventoryManagementGalten\Program.cs:line 14 at InventoryManagementGalten.Program.Main(String[] args) in D:\a\1\s\InventoryManagementGalten\Program.cs:line 10

听起来像是版本不匹配-尽管我不确定在哪里或如何修复它.

which sounds like a version mismatch - although I'm not sure where or how to fix it.

任何想法都非常感谢!

Any ideas are much appreciated!

更新:当我进入应用程序日志时,这是在深夜随机出现的第一个错误:

Update: When I go into application logs, this is the first error that randomly appeared in the middle of the night:

应用程序:dotnet.exe CoreCLR版本:4.6.27129.4说明:该进程由于未处理的异常而终止.异常信息:System.IO.FileLoadException:无法加载文件或程序集'Microsoft.AspNetCore.Server.IISIntegration,Version = 2.1.7.0, 文化=中性,PublicKeyToken = adb9793829ddae60'.找到的程序集的清单定义与程序集引用不匹配. (来自HRESULT的异常:0x80131040),位于InventoryManagementGalten.Program.CreateWebHostBuilder(String [])处的Microsoft.AspNetCore.WebHost.CreateDefaultBuilder(String [] args). D:\ a \ 1 \ s \ InventoryManagementGalten \ Program.cs:第14行中的args)D:\ a \ 1 \ s \ InventoryManagementGalten \ Program.cs:第10行中InventoryManagementGalten.Program.Main(String [] args)

Application: dotnet.exe CoreCLR Version: 4.6.27129.4 Description: The process was terminated due to an unhandled exception. Exception Info: System.IO.FileLoadException: Could not load file or assembly 'Microsoft.AspNetCore.Server.IISIntegration, Version=2.1.7.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) at Microsoft.AspNetCore.WebHost.CreateDefaultBuilder(String[] args) at InventoryManagementGalten.Program.CreateWebHostBuilder(String[] args) in D:\a\1\s\InventoryManagementGalten\Program.cs:line 14 at InventoryManagementGalten.Program.Main(String[] args) in D:\a\1\s\InventoryManagementGalten\Program.cs:line 10

推荐答案

解决方法1

Workaround 1

删除PackageReference,它们已经是Microsoft.AspNetCore.App的一部分.您可以找到有关此内容的列表 通过查看 https://www.nuget.org/packages/microsoft.aspnetcore.app#show-dependency-groups . 这样可以避免版本不匹配.

Remove PackageReference's which are already part of Microsoft.AspNetCore.App. You can find a list of what this package pulls in by looking at https://www.nuget.org/packages/microsoft.aspnetcore.app#show-dependency-groups. This will avoid the version mismatch.

解决方法2

Workaround 2

通过添加  将Microsoft.AspNetCore.App软件包参考升级到最新的2.1.x版本. 版本 属性.

Upgrade the Microsoft.AspNetCore.App PackageReference to the latest 2.1.x version by adding the Version attribute.

  < PackageReference 包含 = " ; Microsoft.AspNetCore.App"   版本 = "2.1.7"   />

  <PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.7" />


这篇关于Azure webapp 502.5错误,出现在任何地方的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 10:12