窗口服务器2016上的.NET核心2.1.3中的HTTP错误502.5

问题描述 投票:2回答:3

我为我的新计算机运行窗口服务器2016 OS安装.NET核心版本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>
iis asp.net-core iis-10 window-server
3个回答
1
投票

确保以下内容:

  1. .NET Core Hosting Bundle安装在托管服务器上 - download from here
  2. 应用程序池.NET CLR版本设置为“无托管代码”
  3. 确保Application Pool Identity用户对已发布的文件夹具有读取权限。详情请查看:https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/?view=aspnetcore-2.0

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


0
投票

或者,对于在运行nuget包Microsoft.Aspnetcore.all 2.1.3时仍然在IIS上遇到.net核心的人,我建议将版本更新为'Latest Stable 2.1.301',因为微软发布了修复程序

其他版本的IIS问题是Microsoft.Aspnetcore.all 2.0.8升级到'Latest Stable 2.1.301'或降级到2.0.7。

无需更改所需的代码或.csproj。

© www.soinside.com 2019 - 2024. All rights reserved.