.NET 5 ASP.NET Core 应用程序未在 Azure 中启动

标签 .net azure asp.net-core .net-5

我正在尝试在 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。服务不可用”。

最佳答案

我也遇到这个错误。

就我而言,问题与Azure App Service 64位/32位平台设置(Web应用程序\配置\常规设置\平台设置 )。

我最近将其更改为 64 位,然后开始出现此错误,当我恢复到 32 位时,问题就消失了。

我还没有确定根本原因,但就其值(value)而言,它就在那里。

关于.NET 5 ASP.NET Core 应用程序未在 Azure 中启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64820156/

相关文章:

.net - 身份验证模式.Net

python - 无法在 docker 容器内安装 pip azure-cognitiveservices-speech

asp.net-core - 如何删除 ASP.NET Core 2.2 中的一些默认标识表

.net - MSIL代码问题

c# - 散列过程如何在 Dictionary<TKey, TValue> 中工作

azure - .NET Core DDD 与持久的 Azure Functions

c# - 使用蓝铜矿测试 Azure Blob 存储

c# - 使用 LINQ select 返回异步任务

c# - ActionFilterAttribute 中的 GetService 返回 null

.net - T4 将输出附加到现有文件