【问题标题】:HTTP 502.5 - ASP.NET Core cannot start in IISHTTP 502.5 - ASP.NET Core 无法在 IIS 中启动
【发布时间】:2019-08-01 16:37:07
【问题描述】:

我在 Windows Server 2012 上的 IIS 上启动 ASP.NET Core 网站时遇到问题

我在 Windows 事件日志中收到以下错误:

Application 'MACHINE/WEBROOT/APPHOST/IDENTITY' with physical root 'D:\CompanyName\IdentityServer\' failed to start process with commandline 'dotnet .\identityserver.dll', ErrorCode = '0x80004005 : ff.

我启用了标准输出日志,但它产生的日志文件是空的 = 0kb。 我更新了整个文件夹以完全控制 IIS 应用程序池用户。

我还安装了 Hosting Bundle,以及 Microsoft Visual C++ 2015 Redistributable...

应用程序运行没有问题,当我在命令行中运行它时:

dotnet .\identityserver.dll

我可以让它运行的唯一方法是将应用程序池标识设置为 NETWORK SERVICE

所以对我来说这似乎是一个权限问题,但应用程序池身份可以访问网站文件夹中的所有内容??

【问题讨论】:

  • 服务器上是否安装了与您开发应用程序相同的 .NET Core 版本?安装 .NET Core 后是否重新启动了服务器?
  • 您应该在BuildWebHost 中添加.UseIISIntegration()program.cs
  • @ElyasEsna 我们使用 CreateDefaultBuilder,默认调用 UseIISIntegration。

标签: asp.net asp.net-core iis-8


【解决方案1】:

您是否已将 .NET Core Runtime 安装到您的服务器并重新启动 IIS? 如果已经安装了一个。尝试检查您的应用程序池 > 在“无托管代码”中选择的“.NET Framework 版本” 如果仍然不起作用,请尝试更改“web.config”中的以下代码

  <aspNetCore processPath="dotnet" arguments=".\mywebsite.dll" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" />
to 
  <aspNetCore processPath="C:\Program Files\dotnet\dotnet.exe" arguments=".\mywebsite.dll" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" />

https://www.microsoft.com/net/download

【讨论】:

  • 感谢您的建议,我已经做到了。当我使用 NETWORK SERVICE 帐户运行它时,它运行良好。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-09-11
  • 1970-01-01
  • 2018-08-18
  • 1970-01-01
相关资源
最近更新 更多