2
votes

I've updated my app from ASP.NET Core 2.2.0 to 3.1.2 and it does not run in Azure App Service any more.

The v3.1.2 runtime is not listed as supported on the App Service host machine. The Kudu api/diagnostics/runtime call returns only older versions:

  ...
  "dotnetcore32": {
    "shared": {
      "microsoft.netcore.app": [ "1.0.16", "1.1.13", "2.0.9", "2.1.14", "2.2.8", "3.0.2", "3.1.1" ],
      "microsoft.aspnetcore.app": [ "2.1.14", "2.1.15", "2.2.8", "3.0.1", "3.0.2", "3.1.0", "3.1.1" ],
      "microsoft.aspnetcore.all": [ "2.1.14", "2.1.15", "2.2.8" ]
    },
    "sdk": [ "1.1.14", "2.1.509", "2.2.109" ]
  },
  "dotnetcore64": {
    "shared": {
      "microsoft.netcore.app": [ "1.0.16", "1.1.13", "2.0.9", "2.1.14", "2.2.8", "3.0.2", "3.1.1" ],
      "microsoft.aspnetcore.app": [ "2.1.14", "2.1.15", "2.2.8", "3.0.1", "3.0.2", "3.1.0", "3.1.1" ],
      "microsoft.aspnetcore.all": [ "2.1.14", "2.1.15", "2.2.8" ]
    },
    "sdk": [ "1.1.14", "2.1.509", "2.2.109" ]
  },
  ...

I thought I could fix that by deploying the app in self-contained mode. However the app now fails with:

System.InvalidOperationException: Startup assembly Microsoft.AspNetCore.AzureAppServices.HostingStartup failed to execute. See the inner exception for more details.
 ---> System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.AspNetCore.AzureAppServices.HostingStartup, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
File name: 'Microsoft.AspNetCore.AzureAppServices.HostingStartup, Culture=neutral, PublicKeyToken=null'
   at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, RuntimeAssembly assemblyContext, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, AssemblyLoadContext assemblyLoadContext)
   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, StackCrawlMark& stackMark, AssemblyLoadContext assemblyLoadContext)
   at System.Reflection.Assembly.Load(AssemblyName assemblyRef, StackCrawlMark& stackMark, AssemblyLoadContext assemblyLoadContext)
   at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
   at Microsoft.AspNetCore.Hosting.WebHostBuilder.BuildCommonServices(AggregateException& hostingStartupErrors)

I would like to know:

  • Why the self-contained mode does not work?
  • Is there any schedule for 3.1.2 runtime support on Azure App Service?
  • I've seen ASP.NET Core runtime 3.1.2 listed among site extensions in Azure Portal, but installing it did not help. What is the extension for?
1
I'm not using app service, but there's an article on medium telling you can select dotnet core 3.1 in azure settings: medium.com/@bharatdwarkani/…Christoph Lütjen

1 Answers

0
votes

I have deployed few apps that use asp.net core 3.1.2 to Azure app services and they are running without a hitch. Take a look at this link

These approaches are also used when the runtime is available but the SDK hasn't been installed on Azure App Service.

To answer your precise questions

  1. The self contained mode should work. Please make sure you are following these steps

  2. dotnet core 3.1.2 is available in app services, But you need to manually install it. For details take a look at this

  3. Sorry man, can't help, never used the said extension.