Iis Windows server 2016上.NET core 2.1.3中的HTTP错误502.5

Iis Windows server 2016上.NET core 2.1.3中的HTTP错误502.5,iis,asp.net-core,iis-10,window-server,Iis,Asp.net Core,Iis 10,Window Server,我为我的新计算机运行的Windows server 2016操作系统安装.NET core 2.1.3版。我在iis10中托管。但它有错误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

我为我的新计算机运行的Windows server 2016操作系统安装.NET core 2.1.3版。我在iis10中托管。但它有错误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>

确保:

  • 托管服务器上安装的.NET Core托管捆绑包-
  • 应用程序池.NET CLR版本设置为“无托管代码”
  • 确保应用程序池标识用户对已发布文件夹具有读取权限。 详情请参阅:

  • 这种情况下,如果您使用:

    Env:Windows Server OS、.NET Core托管捆绑包(包括运行时)、IIS、Asp.NET.Core

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

    <PropertyGroup>
      <PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest>
    </PropertyGroup>
    
    
    假的
    

    参考:

    或者,对于在运行nuget packageMicrosoft.Aspnetcore.all 2.1.3时仍在IIS上与.net core斗争的任何人,我建议将版本更新为“最新稳定的2.1.301”,因为Microsoft已经发布了修复程序

    其他出现IIS问题的版本是Microsoft.Aspnetcore.all 2.0.8升级至“最新稳定版本2.1.301”或降级至2.0.7


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

    是否确实需要使用web.config文件或launchSetting.json?web.config文件已在项目中自动生成您用于创建项目的哪个模板?我使用“web应用程序”和API,但它们都有相同的特性error@AnkurShah:
    launchSettings.json
    在从F5启动或处于调试模式时用于IDE。Web服务器或应用程序本身不使用它。谢谢您的帮助。我将web.config文件中的替换为,它成功了