gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-05 07:11:47 25 4
gpt4 key购买 nike

我已将应用程序从 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 运行时支持是否有任何计划?
  • 我在 Azure 门户的站点扩展中看到了 ASP.NET Core 运行时 3.1.2,但安装它并没有帮助。扩展名有什么用?

最佳答案

我已经将一些使用 asp.net core 3.1.2 的应用程序部署到 Azure 应用程序服务,并且它们运行顺利。看看这个link

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

准确回答您的问题

  1. 自包含模式应该可以工作。请确保您关注these steps

  2. dotnet core 3.1.2已在应用服务中提供,但需要手动安装。详情请查看this

  3. 抱歉,我帮不了你,我从来没有使用过上述扩展。

关于azure - ASP.NET Core 3.1.2 应用程序无法在 Azure 应用服务中启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60638193/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com