Azure 网站上的 .NET CORE 3.1:500.37 ANCM 无法在启动时间限制内启动 [英] .NET CORE 3.1 on Azure Web Sites: 500.37 ANCM Failed to Start Within Startup Time Limit

查看:126
本文介绍了Azure 网站上的 .NET CORE 3.1:500.37 ANCM 无法在启动时间限制内启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有 .NET Core 3.1 API,它部署在 Azure Web 应用程序服务中.由于错误 500.37 ANCM 未能在启动时限内启动.我通过增加 web.config 中的 startupTimeLimit 设法解决了这个问题(如下所示).

I have .NET Core 3.1 API which is deployed in Azure web application service. I had trouble running the application in Azure because of the error 500.37 ANCM Failed to Start Within Startup Time Limit. I managed to solve this issue by increasing startupTimeLimit in web.config (as you can see below).

但是现在,当我在 Azure Web 应用服务中运行 2 个实例时.其中一个实例工作正常,但另一个仍然出现相同的错误.

But Now, when I'm running 2 instances in Azure web app service. One of the instances works just fine but the other one still has the same error.

关于如何在 IIS 中为多个实例设置 startupTimeLimit 的任何想法?

Any ideas on how How to set startupTimeLimit for multiple instances in IIS?

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <!-- To customize the asp.net core module uncomment and edit the following section. 
  For more info see https://go.microsoft.com/fwlink/?linkid=838655 -->
  <system.webServer>
    <httpProtocol>
      <customHeaders>
        <remove name="X-Powered-By" />
      </customHeaders>
    </httpProtocol>
    <handlers>
      <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
    </handlers>
    <aspNetCore processPath="dotnet" arguments=".Clients.Api.dll" stdoutLogEnabled="false" stdoutLogFile=".logsstdout" startupTimeLimit="180" hostingModel="inprocess" >
    </aspNetCore>
  </system.webServer>
</configuration>

我使用了 azure 网络应用程序 横向扩展(应用服务计划),将正在运行的实例增加到 2 个.

I used azure web app Scale out (App Service plan) to increase the running instance to 2.

推荐答案

我们通过将 startupTimeLimit 增加到 300 来解决这个解决方案

We solved this solution by increasing the startupTimeLimit to 300

<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
  <location>
    <system.webServer>
      <aspNetCore xdt:Transform="SetAttributes(startupTimeLimit)" startupTimeLimit="300">
      </aspNetCore>
    </system.webServer>
  </location>
</configuration>

这篇关于Azure 网站上的 .NET CORE 3.1:500.37 ANCM 无法在启动时间限制内启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆