简体   繁体   中英

The specified framework 'Microsoft.AspNetCore.App', version '2.2.0' was not found. - Azure App Service on Linux

I have an app running in Azure App Service on Linux and decided to upgrade the app from .NET Core 2.1 to .NET Core 2.2. It is modeled after a .NET Core 2.2 dotnet new angular template.

My app builds in Azure DevOps using the Azure Web App for ASP.NET template and its defaults plus the following updates to the Azure App Service Deploy task:


App Service type : Azure Web App for Linux

Runtime Stack : .NET Core 2.2

Startup command : dotnet MyAppName.dll


This task deploys the app successfully and I confirm the deployed contents through FTP.

Starting and navigating to the app shows this page:

在此处输入图片说明

Locally, my app runs successfully in Debug and Release modes in Visual Studio 2017. It will also work if I host the contents of a dotnet publish -c Release command locally.

I enabled logs using Monitoring > Diagnostics logs in the Azure portal and found this message in the file 2019_02_14_RD00155D99205C_default_docker.log :

2019-02-14T19:52:29.377625884Z   _____                               
2019-02-14T19:52:29.377672685Z   /  _  \ __________ _________   ____  
2019-02-14T19:52:29.377679386Z  /  /_\  \___   /  |  \_  __ \_/ __ \ 
2019-02-14T19:52:29.377684186Z /    |    \/    /|  |  /|  | \/\  ___/ 
2019-02-14T19:52:29.377688886Z \____|__  /_____ \____/ |__|    \___  >
2019-02-14T19:52:29.377693986Z         \/      \/                  \/ 
2019-02-14T19:52:29.377698686Z A P P   S E R V I C E   O N   L I N U X
2019-02-14T19:52:29.377703186Z 
2019-02-14T19:52:29.377707486Z Documentation: http://aka.ms/webapp-linux
2019-02-14T19:52:29.377711986Z Dotnet quickstart: https://aka.ms/dotnet-qs
2019-02-14T19:52:29.377716587Z 
2019-02-14T19:52:29.956004709Z Starting OpenBSD Secure Shell server: sshd.
2019-02-14T19:52:30.234443169Z The specified framework 'Microsoft.AspNetCore.App', version '2.2.0' was not found.
2019-02-14T19:52:30.234492570Z   - Check application dependencies and target a framework version installed at:
2019-02-14T19:52:30.234498570Z       /usr/share/dotnet/shared/Microsoft.AspNetCore.App
2019-02-14T19:52:30.234615073Z   - Alternatively, install the framework version '2.2.0'.

I have not found any other clues. Does this imply that the default image Azure provides is not correct when setting Runtime Stack to .NET Core 2.2?


Update Found this link which mentions that 2.2 on Linux is being "rolled out" as of 02/12/2019. Perhaps this means that a correct image is not deployed yet where my App Service is located (US East). Assuming that is what is going on, adding a new non-working 2.2 option to the Azure Portal and Azure DevOps UI is a poor user experience.

I tested again today and am able to deploy a .NET Core 2.2 Linux app. Most likely this started working February 26, 2018, judging by the latest edit on this Github issue .

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