首页 > 解决方案 > 找不到指定的框架“Microsoft.AspNetCore.App”,版本“2.2.5”

问题描述

将我的 Web 应用程序的 targetFramework 从升级netcoreapp2.1netcoreapp2.2我的 Web 应用程序后,在本地计算机上运行良好,但在发布到 Azure WebApp 环境时无法启动并出现以下错误:

HTTP Error 502.5 - ANCM Out-Of-Process Startup Failure
Common causes of this issue:
The application process failed to start
The application process started but then stopped
The application process started but failed to listen on the configured port
Troubleshooting steps:
Check the system event log for error messages
Enable logging the application process' stdout messages
Attach a debugger to the application process and inspect
For more information visit: https://go.microsoft.com/fwlink/?LinkID=808681

如果我转到 Azure 控制台并尝试手动运行应用程序,dotnet xxx.dll我会收到以下错误:

在此处输入图像描述

我的参考Microsoft.AspNetCore.App是在没有警告建议的版本的情况下添加的:

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

我在这里发现了以前版本更新的类似问题,但对我没有帮助: https ://github.com/aspnet/AspNetCore.Docs/issues/8794

如何解决此问题?

标签: .netasp.net-core.net-coreasp.net-core-2.1netcoreapp2.1

解决方案


查看错误似乎尚未在 Azure Web 应用程序实例上安装 ASP.NET Core 2.2.5。您必须等待或明确指定要使用的运行时版本,而不是 SDK 选择最新版本:

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

更新项目文件后,您必须重新发布您的应用程序。


推荐阅读