找不到指定的框架'Microsoft.AspNetCore.App'版本'2.2.5'

时间:2019-05-20 05:35:19

标签: .net asp.net-core .net-core asp.net-core-2.1 netcoreapp2.1

将我的Web应用程序的targetFramework从netcoreapp2.1升级到netcoreapp2.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手动运行应用程序,则会出现以下错误:

enter image description here

我对Microsoft.AspNetCore.App的引用未添加警告所建议的版本:

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

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

如何解决此问题?

1 个答案:

答案 0 :(得分:1)

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

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

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