我有一个在 Linux 上的 Azure App Service 中运行的应用程序,并决定将该应用程序从 .NET Core 2.1 升级到 .NET Core 2.2。它以.NET Core 2.2 dotnet new angular模板为模型。
我的应用使用Azure Web App for ASP.NET模板及其默认值以及对Azure App Service Deploy任务的以下更新在 Azure DevOps 中构建:
应用服务类型:适用于 Linux 的 Azure Web 应用
运行时堆栈:.NET Core 2.2
启动命令:dotnet MyAppName.dll
此任务成功部署应用程序,我通过 FTP 确认部署的内容。
启动并导航到应用程序会显示此页面:
dotnet publish -c Release在本地,我的应用程序在 Visual Studio 2017 的调试和发布模式下成功运行。如果我在本地托管命令的内容,它也可以工作。
我在 Azure 门户中使用 Monitoring > Diagnostics logs 启用了日志,并在文件中找到了这条消息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'.
我没有找到任何其他线索。这是否意味着将 Runtime Stack 设置为 .NET Core 2.2 时 Azure 提供的默认映像不正确?
更新 发现这个链接提到 Linux 上的 2.2 自 2019 年 2 月 12 日起正在“推出”。也许这意味着尚未在我的应用服务所在的位置(美国东部)部署正确的映像。假设这是正在发生的事情,向 Azure 门户和 Azure DevOps UI 添加一个新的非工作 2.2 选项是一个糟糕的用户体验。
