从 .NET Core 1.1.1 升级到 .NET Core 1.1.2 后,Azure 上的 ASP.NET Core 网站无法启动并出现 502.5 错误 [英] ASP.NET Core website on Azure fails to start with a 502.5 error after upgrade from .NET Core 1.1.1 to .NET Core 1.1.2

查看:26
本文介绍了从 .NET Core 1.1.1 升级到 .NET Core 1.1.2 后,Azure 上的 ASP.NET Core 网站无法启动并出现 502.5 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 .NET Core Web 应用程序,我将其部署为 Azure Web 应用程序.

I have a .NET Core web application which I deploy as an Azure Web App.

直到昨晚我应用 Visual Studio 2017 升级 (v15.2) 之前,这一直运行良好.

This has been working perfectly until last night when I applied the Visual Studio 2017 upgrade (v15.2).

.net core 版本从 1.1.1 升级到 1.1.2.当我部署到 Azure 时,网站无法启动,出现 502.5 错误.

The .net core version was upgraded from 1.1.1 to 1.1.2. When I deploy to Azure the website fails to start with a 502.5 error.

经过调查,我发现 .NET Core 1.1.2 未部署到 Azure 映像.

After investigating I can see .NET Core 1.1.2 is not deployed to the Azure image.

我无法将新框架安装到 Web 应用程序实例(可以理解,对 Program Files 目录的权限被拒绝).我无法通过 nuget 包管理器降级",因为它报告版本被项目阻止".我看不到在 csproj 文件中定义 Microsoft.NETCore.App 版本的方法,因为这似乎是由根 <Project Sdk="Microsoft.NET.Sdk.Web"> '自动'控制的. 元素.

I cannot install the new framework to the web app instance (understandably permission is denied on the Program Files directory). I cannot 'downgrade' through the nuget package manager as it reports the version is 'Blocked by the project'. I cannot see a way to define the version of Microsoft.NETCore.App in the csproj file as it seems this is 'automagically' controlled by the root <Project Sdk="Microsoft.NET.Sdk.Web"> element.

我尝试过自包含部署(随 Web 应用程序一起提供框架),但也无法正常工作.

I have tried attempting a self contained deployment (shipping the framework with the web app) but can't get this working either.

等待将新版本部署到 Azure 的时间很短(我找不到有关他们的时间表的任何信息)是否有人对如何让 Web 应用程序再次运行有任何想法?

Short of waiting for the new version to be deployed to Azure (I can't find any information on their schedule for this) does anyone have any ideas on how to get the web app working again?

有没有办法强制它在1.1.1下运行?

Is there any way to force it to run under 1.1.1?

推荐答案

Update 5/12/2017:我们加快了 1.1.2 和 1.0.5 到 App Service 的部署,它是现在完成.因此,任何人都不再需要以下解决方法.

Update 5/12/2017: we have accelerated the deployment of 1.1.2 and 1.0.5 to App Service and it is now complete. So the workaround below should no longer be needed by anyone.

原始解决方案

最好的解决方法是在您的 .csproj 文件中进行设置:

The best workaround is to set this in your .csproj file:

<TargetFramework>netcoreapp1.1.1</TargetFramework>

而不是将其设置为 netcoreapp1.1.我们将在周二之前将 1.1.2 部署到 Azure 应用服务,届时将不需要解决方法.

Instead of it being set to netcoreapp1.1. We will have 1.1.2 deployed to Azure App Service by Tuesday, at which point the workaround won't be necessary.

请注意,如果您将其设置为 netcoreapp1.1.1,则一旦 1.1.2 可用,它将自动前滚到该版本.因此,将其设置为 netcoreapp1.1.1 不会让您卡住"到该版本.只要您使用便携式模式(即依赖于操作系统上的框架),这就是正确的.如果您使用独立并部署您自己的框架,那么您将坚持使用它(但您一开始就不会遇到这个问题,也不需要这样做!).

Note that if if you set it to netcoreapp1.1.1, once 1.1.2 is available it will auto-roll forward to that. So setting it to netcoreapp1.1.1 does not keep you 'stuck' to that version. This is true as long as you use Portable mode (i.e. rely on the framework that's on the OS). If you use standalone and deploy your own framework, then you would be stuck to it (but then you would not have had this issue in the first place and would not have needed to do that!).

这篇关于从 .NET Core 1.1.1 升级到 .NET Core 1.1.2 后,Azure 上的 ASP.NET Core 网站无法启动并出现 502.5 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆