.NET 5 ASP.NET核心应用程序无法在Azure中启动

iyfjxgzm  于 2023-01-27  发布在  .NET
关注(0)|答案(1)|浏览(241)

我正在尝试在Azure中托管.NET 5 ASP.NET Core Web API。不幸的是,应用程序没有启动,因为“诊断问题”也看到了。看起来它陷入了启动循环,因为我在日志流中一遍又一遍地得到相同的消息:

2020-11-13T11:25:43 Start 'Microsoft.AspNetCore.AzureAppServices.SiteExtension' site extension transform
2020-11-13T11:25:44 StartSection Executing InsertIfMissing (transform line 7, 23)
2020-11-13T11:25:44 on /configuration/system.webServer
2020-11-13T11:25:44 Applying to 'configuration' element (no source line info)
2020-11-13T11:25:44 EndSection Done executing InsertIfMissing
2020-11-13T11:25:44 StartSection Executing InsertIfMissing (transform line 8, 16)
2020-11-13T11:25:44 on /configuration/system.webServer/runtime
2020-11-13T11:25:44 Applying to 'system.webServer' element (no source line info)
2020-11-13T11:25:44 EndSection Done executing InsertIfMissing
2020-11-13T11:25:44 StartSection Executing InsertIfMissing (transform line 9, 31)
2020-11-13T11:25:44 on /configuration/system.webServer/runtime/environmentVariables
2020-11-13T11:25:44 Applying to 'runtime' element (no source line info)
2020-11-13T11:25:44 EndSection Done executing InsertIfMissing
2020-11-13T11:25:44 StartSection Executing InsertOrAppendAttribute (transform line 10, 406)
2020-11-13T11:25:44 on /configuration/system.webServer/runtime/environmentVariables/add[@name='DOTNET_ADDITIONAL_DEPS']
2020-11-13T11:25:44 Applying to 'environmentVariables' element (no source line info)
2020-11-13T11:25:44 EndSection Done executing InsertOrAppendAttribute
2020-11-13T11:25:44 StartSection Executing InsertOrAppendAttribute (transform line 11, 158)
2020-11-13T11:25:44 on /configuration/system.webServer/runtime/environmentVariables/add[@name='DOTNET_SHARED_STORE']
2020-11-13T11:25:44 Applying to 'environmentVariables' element (no source line info)
2020-11-13T11:25:44 EndSection Done executing InsertOrAppendAttribute
2020-11-13T11:25:44 StartSection Executing InsertOrAppendAttribute (transform line 12, 146)
2020-11-13T11:25:44 on /configuration/system.webServer/runtime/environmentVariables/add[@name='ASPNETCORE_HOSTINGSTARTUPASSEMBLIES']
2020-11-13T11:25:44 Applying to 'environmentVariables' element (no source line info)
2020-11-13T11:25:44 EndSection Done executing InsertOrAppendAttribute
2020-11-13T11:25:44 Successful 'C:\home\SiteExtensions\Microsoft.AspNetCore.AzureAppServices.SiteExtension\applicationHost.xdt' site extension transform
2020-11-13T11:25:44 sandboxproc.exe complete successfully. Elapsed = 1208.00 ms
2020-11-13T11:25:56 sandboxproc.exe D:\DWASFiles\Sites\fotoapp-api\Temp\applicationhost.config True True
2020-11-13T11:25:57 env XPROC_TYPENAME=Microsoft.Web.Hosting.Transformers.ApplicationHost.SiteExtensionHelper, Microsoft.Web.Hosting, Version=7.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
2020-11-13T11:25:57 env XPROC_METHODNAME=Transform
<these messages repeat endlessly>

我尝试了依赖于框架的部署(在应用服务中启用了.NET 5运行时)和自包含部署。
我在任何地方都找不到更好的日志。尚不支持Application Insights。
对API的请求无法到达日志流。大约2分钟后,服务器响应“HTTP错误503。服务不可用”。

bjp0bcyl

bjp0bcyl1#

我也有这个错误。
在我的案例中,问题与Azure应用服务64位/ 32位平台设置(*Web应用\配置\常规设置\平台设置 *)有关。
我最近把它改成了64位,然后开始出现这个错误,当我恢复到32位时,问题就消失了。
我还没有确定根本原因,但无论如何,它是。

相关问题