2

我为我的新计算机运行 windows server 2016 操作系统安装 .NET core 版本 2.1.3。我在 IIS 10 中托管。但它有错误 502

HTTP Error 502.5 - Process Failure

Common causes of this issue:
The application process failed to start
The application process started but then stopped
The application process started but failed to listen on the configured port

这是我的 web.config 片段

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.webServer>
    <handlers>
      <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
    </handlers>
    <aspNetCore processPath="dotnet" arguments=".\WebApplication1.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
  </system.webServer>
</configuration>
4

3 回答 3

1

确保以下内容:

  1. 安装在托管服务器上的 .NET Core Hosting Bundle -从此处下载
  2. 应用程序池 .NET CLR 版本设置为“无托管代码”
  3. 确保应用程序池标识用户对已发布文件夹具有读取权限。有关详细信息,请查看:https ://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/?view=aspnetcore-2.0
于 2018-06-06T11:23:44.173 回答
0

如果您使用以下情况:

环境:Windows Server OS、.NET Core Hosting Bundle(包括运行时)、IIS、Asp.Net.Core

您可以在 {YourProject}.csproj 文件中添加如下元素:

<PropertyGroup>
  <PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest>
</PropertyGroup>

参考:https ://github.com/dotnet/coreclr/issues/13542

于 2018-06-12T02:57:24.133 回答
0

或者,对于在运行 nuget 包Microsoft.Aspnetcore.all 2.1.3时仍在 IIS 上苦苦挣扎的任何人,我建议将版本更新为“最新稳定版 2.1.301”,因为微软已经发布了修复程序

其他有 IIS 问题的版本是Microsoft.Aspnetcore.all 2.0.8,要么升级到“最新稳定版 2.1.301”,要么降级到 2.0.7。

无需代码或 .csproj 即可进行更改。

于 2018-09-04T10:55:23.960 回答