.net - 找不到指定的框架“Microsoft.AspNetCore.App”,版本“2.2.5”
问题描述
将我的 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
我会收到以下错误:
我的参考Microsoft.AspNetCore.App
是在没有警告建议的版本的情况下添加的:
<PackageReference Include="Microsoft.AspNetCore.App" />
我在这里发现了以前版本更新的类似问题,但对我没有帮助: https ://github.com/aspnet/AspNetCore.Docs/issues/8794
如何解决此问题?
解决方案
查看错误似乎尚未在 Azure Web 应用程序实例上安装 ASP.NET Core 2.2.5。您必须等待或明确指定要使用的运行时版本,而不是 SDK 选择最新版本:
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.2.4" />
更新项目文件后,您必须重新发布您的应用程序。
推荐阅读
- javascript - 在 jquery 中单击 1 次但多次提醒
- javascript - 由于我认为的特殊性,在 javascript 中没有发生切换插入符号/don 按钮
- microsoft-teams - 在任务 Microsoft Teams 的 iframe 中发送 POST 请求
- python - 在 Django 中交叉加入
- javascript - 以漂亮的方式为多个类属性分配相同的值
- java - 覆盖基类中的非标识符属性并使其成为子类中的标识符
- jestjs - Jest 覆盖不应在路径中包含 rootDir,与 Cypress 覆盖不匹配
- java - 如何使用 MessagePack 构建 Java 微服务架构
- azure-active-directory - MSAL.Net 连接到与 ADFS 联合的 Azure AD
- javascript - “动作”类型上不存在 Angular ngrx 属性“有效负载”