iis 为什么在安装.NET Core 2.1.3时出现HTTP错误502.5

9gm1akwq  于 2022-11-12  发布在  .NET
关注(0)|答案(3)|浏览(232)

我为运行Windows Server 2016的新计算机安装了.NET Core 2.1.3版。我将其托管在IIS 10中。但它向我显示了错误502:
HTTP错误502.5 -进程失败
此问题的常见原因:应用程序进程未能启动应用程序进程已启动,但随后停止应用程序进程已启动,但未能侦听配置的端口
这是我编写的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>
luaexgnf

luaexgnf1#

请确保:
1..NET核心托管捆绑包已安装在托管服务器上-download from here
1.应用程序池.NET CLR版本设置为“无托管代码”
1.请确保应用程序池标识用户具有对已发布文件夹的读取权限。有关详细信息,请查看:https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/?view=aspnetcore-2.0

5tmbdcev

5tmbdcev2#

在这种情况下,如果您用途:
环境:Windows Server操作系统,.NET核心托管包(包括运行时),IIS,Asp.Net。核心
您可以按如下所示将元素添加到{YourProject}.csproj文件中:

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

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

ax6ht2ek

ax6ht2ek3#

或者,对于那些在运行nuget软件包Microsoft.Aspnetcore.all 2.1.3时仍在IIS上与.net core作斗争的人,我建议将版本更新到“最新稳定的2.1.301”,因为微软已经发布了修复程序
存在IIS问题的其他版本是Microsoft.Aspnetcore.all 2.0.8请升级到“最新稳定版本2.1.301”或降级到2.0.7。
不需要代码或.csproj进行更改。

相关问题