我有部署在Azure Web应用程序服务中的.NET Core 3.1 API。我在Azure中运行应用程序时遇到问题,因为错误500.37 ANCM无法在启动时间限制内启动。我通过增加web.config中的startupTimeLimit(如下所示)设法解决了此问题。
但是现在,当我在Azure Web应用服务中运行2个示例时,其中一个示例工作正常,但另一个仍然有相同的错误。
如何在IIS中为多个示例设置startupTimeLimit?
网页配置
<?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=".\logs\stdout" startupTimeLimit="180" hostingModel="inprocess" >
</aspNetCore>
</system.webServer>
</configuration>
编辑:
我使用azure web app Scale out (App Service plan)将正在运行的示例增加到2。
3条答案
按热度按时间nzkunb0c1#
我们通过将startupTimeLimit增加到300来解决此解决方案
uqdfh47h2#
最后我能够修复这个错误。
这是一个配置错误(.net核心配置)。当项目在.net核心3.1中时,Azure应用服务需要项目的其他配置。解决方案是:
<AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel>
最终的 *.proj文件将如下所示:
添加这些更改并在Azure应用服务上上传新版本后,应用将无错误地执行(除非有其他与您的代码相关的内容)。
我能够通过从本地直接在IIS上执行我的项目来复制此错误,当您执行此操作时,VS将打开Web浏览器,但Web页面从未加载。
lkaoscv73#
如果应用程序在开发计算机上运行正常,而此错误存在于***未连接到Internet***生产服务器上
检查事件日志,查找是否有类似以下错误:
从自动更新cab中提取第三方根目录列表失败
您只需要更新服务器证书
1.使用联机选项:将服务器连接到互联网
1.使用“脱机”选项:follow this guide