ASP.NET Core 3.1.2应用程序无法在Azure应用程序服务中启动

ASP.NET Core 3.1.2应用程序无法在Azure应用程序服务中启动,azure,asp.net-core,.net-core,azure-web-app-service,asp.net-core-3.1,Azure,Asp.net Core,.net Core,Azure Web App Service,Asp.net Core 3.1,我已将我的应用程序从ASP.NET Core 2.2.0更新为3.1.2,它不再在Azure应用程序服务中运行 应用程序服务主机不支持v3.1.2运行时。Kudu api/diagnostics/runtime调用仅返回旧版本: ... "dotnetcore32": { "shared": { "microsoft.netcore.app": [ "1.0.16", "1.1.13", "2.0.9", "2.1.14", "2.2.8", "3.0.2", "3.

我已将我的应用程序从ASP.NET Core 2.2.0更新为3.1.2,它不再在Azure应用程序服务中运行

应用程序服务主机不支持v3.1.2运行时。Kudu api/diagnostics/runtime调用仅返回旧版本:

  ...
  "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" ]
  },
  ...
我想我可以通过以自包含模式部署应用程序来解决这个问题。但是,应用程序现在失败,原因是:

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)
我想知道:

为什么自包含模式不起作用? Azure应用程序服务上的3.1.2运行时支持是否有时间表? 我已经看到ASP.NET核心运行时3.1.2在Azure Portal的站点扩展中列出,但安装它并没有帮助。分机是干什么的?
我已经将一些使用asp.net core 3.1.2的应用程序部署到Azure应用程序服务中,并且它们运行顺利。看看这个

当运行时可用但 Azure应用程序服务上尚未安装SDK

回答你确切的问题

自包含模式应该可以工作。请确保您正在跟踪

dotnet core 3.1.2在应用程序服务中可用,但您需要手动安装。有关详细信息,请参阅

对不起,伙计,我帮不了你,从来没用过这个分机


我没有使用应用程序服务,但媒体上有一篇文章告诉你可以在azure设置中选择dotnet core 3.1:你在2中的链接已断开。抱歉,这是正确的链接。感谢你抽出时间回答我的问题。我没有找到确切的原因,但我最终修复了该应用程序,在我的程序类中从web主机生成器切换到主机生成器,并删除UseKestrel和UseIIsinIntegration调用。