【问题标题】:Azure App Service doesn't run after upgrading to DotNet Core 2.2升级到 DotNet Core 2.2 后 Azure 应用服务不运行
【发布时间】:2019-05-06 08:08:30
【问题描述】:

DotNet Core 2.2 发布后,我将解决方案升级到新版本,但当我将其部署到 Azure 应用服务时,它不再运行。它只是给出以下错误: The page cannot be displayed because an internal server error has occurred.

我的.csproj 文件如下所示,以备您需要时使用:

  <PropertyGroup>
    <TargetFramework>netcoreapp2.2</TargetFramework>
    <DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.App" />
    <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="2.2.0" />
    <PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
    <PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.0.2105168" />
    <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.2.0" />
  </ItemGroup>

  <ItemGroup>
    <ProjectReference Include="..\DAL\DAL.csproj" />
    <ProjectReference Include="..\Model\Models.csproj" />
  </ItemGroup>

  <ItemGroup>
    <WCFMetadata Include="Connected Services" />
  </ItemGroup>

  <ItemGroup>
    <Folder Include="wwwroot\userPictures\" />
  </ItemGroup>

</Project>

【问题讨论】:

  • 在 Azure 门户上,转到应用服务 > 控制台。输入dotnet --list-runtimes 看看是否有2.2。如果是,cd ..\..\LogFilestype eventlog.xml - 最后几行应该向您展示它真正遇到的问题。
  • GitHub 上也注册了问题,解决方法:github.com/dotnet/core/issues/2125#issuecomment-446103571

标签: c# .net azure .net-core azure-web-app-service


【解决方案1】:

似乎 asp.net core 2.2 更新尚未完全推广到 Azure 应用服务的所有区域。见:https://blogs.msdn.microsoft.com/webdev/2018/12/04/asp-net-core-2-2-available-today/

他们说它将在未来几周内推出,并在 12 月底完成。

似乎有某种解决方法,虽然我不知道具体情况: https://github.com/dotnet/core/blob/master/release-notes/2.2/2.2-known-issues.md

【讨论】:

  • 在实际支持它们所依赖的 SDK 版本之前,要求 Microsoft 将 NuGet 包保留在预发布版本中会不会太过分?
【解决方案2】:

我注意到 nuget 通过将 AspNetCoreHosting 更改为 AspNetCoreHostingV2 更新了 web.config。我恢复到AspNetCoreHosting,该应用程序直接重新上线。根据@Dan 的回答链接,看来这将在年底前修复。

为了记录,我使用的是 net472 而不是 netcoreapp2.2

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-05-08
    • 2020-05-25
    • 1970-01-01
    • 2020-01-29
    • 2016-10-30
    相关资源
    最近更新 更多