【问题标题】:Hosting Asp.Net Core 3.0 in Azure: HTTP Error 500.31 - ANCM Failed to Find Native Dependencies在 Azure 中托管 Asp.Net Core 3.0:HTTP 错误 500.31 - ANCM 无法找到本机依赖项
【发布时间】:2020-01-28 03:16:26
【问题描述】:

我正在尝试在 Azure 中托管 ASP.NET Core 3.0 API:

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>netcoreapp3.0</TargetFramework>
  </PropertyGroup>

  <PropertyGroup>
    <IsPackable>false</IsPackable>
    <NeutralLanguage>en-US</NeutralLanguage>
    <LangVersion>latest</LangVersion>   
  </PropertyGroup>  

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="3.*" />
    <PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="3.*" />
    <PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="3.*" />
    <PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore" Version="3.*" />
  </ItemGroup>       

</Project>

但是当我运行 de application 我得到:

HTTP Error 500.31 - ANCM Failed to Find Native Dependencies

Common solutions to this issue:
The specified version of Microsoft.NetCore.App or Microsoft.AspNetCore.App was not found.
Specific error detected by ANCM:
It was not possible to find any compatible framework version The specified framework 'Microsoft.AspNetCore.App', version '3.0.0' was not found. - The following frameworks were found: 2.1.12 at [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App] 2.1.13 at [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App] 2.2.6 at [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App] 2.2.7 at [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App] You can resolve the problem by installing the specified framework and/or SDK. The .NET Core frameworks can be found at: - https://aka.ms/dotnet-download

我错过了什么?

【问题讨论】:

    标签: azure asp.net-core-3.0


    【解决方案1】:

    当前picture 是ASP.NET Core 3.0 随处可用(但SDK 不可用)。

    尽管如此,我(似乎是随机地)得到了一个

    HTTP Error 500.31 - ANCM Failed to Find Native Dependencies
    

    直到我意识到通过将stdoutLogEnabled 设置为true 来激活web.config 的登录没有stdoutLogFile 调整为\\?\%home%\LogFiles\stdout(如Troubleshoot ASP.NET Core on Azure App Service and IIS 中所建议的那样)是原因此错误消息。

    我花了几个小时才意识到这种因果关系。

    【讨论】:

    • 你为我节省了这些时间 - 非常感谢!!
    • 在我的情况下也是 arguments="CorrectPathOfDll"
    【解决方案2】:

    【讨论】:

      【解决方案3】:

      在 web.config 中更改:

      <handlers>
           <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
      </handlers>
      

      到这里:

      <handlers>
           <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
      </handlers>
      

      我从这个modules="AspNetCoreModuleV2" 中删除了V2,它可以工作。

      【讨论】:

        猜你喜欢
        • 2019-10-30
        • 2020-08-09
        • 2020-08-14
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多