我为我的新计算机运行窗口服务器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>
确保以下内容:
这种情况如果你使用:
环境:Windows Server OS,.NET Core Hosting Bundle(包括运行时),IIS,Asp.Net.Core
您可以在{YourProject} .csproj文件中添加如下元素:
<PropertyGroup>
<PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest>
</PropertyGroup>
或者,对于在运行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。