简体   繁体   中英

The specified framework 'Microsoft.AspNetCore.App', version '2.2.5' was not found

After upgrading targetFramework for my web app from netcoreapp2.1 to netcoreapp2.2 my web app works great on local machine but when published to Azure WebApp environment fails to start with the following error:

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

And if I go to Azure console and try to run the app manually with dotnet xxx.dll I get the following error:

在此输入图像描述

My reference to Microsoft.AspNetCore.App is added without the version as recommended by the warning:

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

I've found the similar issue here for previous version update but with no help to me: https://github.com/aspnet/AspNetCore.Docs/issues/8794

How can I troubleshoot this issue?

Looking at the error it seems that ASP.NET Core 2.2.5 is not yet installed on the Azure web app instances. You'll either have to wait or explicitly specify the runtime version you want to use instead of the SDK picking the latest version:

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

After you've updated the project file you have to re-publish your application.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM