Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hosting Asp.Net Core 3.0 in Azure: HTTP Error 500.31 - ANCM Failed to Find Native Dependencies

I am trying to host an ASP.NET Core 3.0 API in Azure:

<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>

But when I run de application I get:

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

What am I missing?

like image 609
Miguel Moura Avatar asked Dec 14 '22 10:12

Miguel Moura


2 Answers

The current picture is that ASP.NET Core 3.0 is available everywhere (but not the SDK).

Despite this fact, I (seemingly randomly) got a

HTTP Error 500.31 - ANCM Failed to Find Native Dependencies

until I realized that activating logging in web.config by setting stdoutLogEnabled to true without adjusting the stdoutLogFile to \\?\%home%\LogFiles\stdout (as suggested in Troubleshoot ASP.NET Core on Azure App Service and IIS) was the cause of this error message.

Took me some hours to realize this causality.

like image 85
Dejan Avatar answered May 10 '23 10:05

Dejan


ASP.NET Core 3.0 not currently available for Azure App Service. [Microsoft Docs]

The preview versions of .NET Core 3.0 [Microsoft Docs] are available on the Azure service.

like image 31
Winthorpe Avatar answered May 10 '23 12:05

Winthorpe