ASP.NET Core 2.1 给我 HTTP 错误 502.5 - 进程失败

ASP.NET Core 2.1 Give me HTTP Error 502.5 - Process Failure

将我的 .NET Core 2.1 应用程序部署到服务器后,访问页面时出现以下错误:

HTTP Error 502.5 - Process Failure

按照 Microsoft 在同一页面上总是有帮助的 link(咳咳),我检查了事件视图日志,它指出:

Application 'MACHINE/WEBROOT/APPHOST/BLAH.COM' with physical root 'D:\inetpub\vhosts\BLAH.com\httpdocs\' failed to start process with commandline 'dotnet .\blah.dll', ErrorCode = '0x80070002 : 0.

该消息不仅没有帮助,而且完全不相关。我尝试在 web.config:

中启用 Web 应用程序的登录
<aspNetCore requestTimeout="23:00:00" processPath="dotnet" arguments=".\blah.dll" forwardWindowsAuthToken="false" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" startupTimeLimit="3600" />

奇怪的是,在我获得运行对我的 IWPD 进程的许可之前,不会在日志目录中创建任何文件。它创建的文件不在指定的 stdout 目录中,而是在父日志目录中。它们也是空的。

我从命令行使用 运行 Web 应用程序:

网络.\blah.dll

该应用程序出现在 运行 上,我可以在屏幕上看到一些消息,但我在访问该站点时仍然遇到相同的 502.2 错误,日志中没有其他信息。我遵循了 ASP.NET Core 2.1 的故障排除步骤,它提到了这一点:

If the errors occur when making a request to the app, make a request to the host and port where Kestrel listens. Using the default host and post, make a request to http://localhost:5000/. If the app responds normally at the Kestrel endpoint address, the problem is more likely related to the reverse proxy configuration and less likely within the app.

我从命令行 运行 Web 应用程序并尝试使用 http://localhost:5000 访问它。我终于能够访问该站点,但我仍然通过 IIS 遇到相同的 502.2 错误。

很明显 IIS 和 Kestrel 没有相互通信。我不明白为什么有两个网络服务器以及如何让它们相互通信。

问题解决了。服务器 IIS 模块的安装程序不会重新启动或警告用户重新启动 IIS。重新启动 IIS 加载了必要的模块。显然,这是任何其他名称的错误。