微软官网,几乎没啥用
Internet 信息服务 (IIS) 网页上的 HTTP 错误 500.19 - Internet Information Services | Microsoft Learn
情况1:
报错 modules="AspNetCoreModuleV2" 主要是由于缺少模块导致
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\YiSha.Admin.Web.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />
</system.webServer>
</location>
</configuration>
<!--ProjectGuid: 06f9bbca-932b-4ab1-940c-e604ac82fa0f-->
解决办法下载bundle(包含 ASP.NET Core IIS Module)
Download ASP.NET Core 3.1 Runtime (v3.1.4) - Windows Hosting Bundle Installer
contains everything you need to run existing web/server apps. The bundle includes the .NET Core runtime, the ASP.NET Core runtime, and if installed on a machine with IIS it will also add the ASP.NET Core IIS Module. If you only want the .NET Core or ASP.NET Core runtime, you'll find them in .NET Core 3.1 Downloads.
执行 dotnet --version 及dotnet --info 显示如下
Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.
C:\Users\wuxx>dotnet --version
3.1.201
C:\Users\wuxx>dotnet --info
.NET Core SDK (reflecting any global.json):
Version: 3.1.201
Commit: b1768b4ae7
Runtime Environment:
OS Name: Windows
OS Version: 6.3.9600
OS Platform: Windows
RID: win81-x64
Base Path: C:\Program Files\dotnet\sdk\3.1.201\
Host (useful for support):
Version: 3.1.3
Commit: 4a9f85e9f8
.NET Core SDKs installed:
3.1.201 [C:\Program Files\dotnet\sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.2.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.2.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.2.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
情况2:迁移后,服务器环境不一致导致IIS没法正常加载web.config
需要安装dotnet-hosting-8.0.11-win 才能解决

下载地址如下:

本文解决因缺少模块而导致的AspNetCoreModuleV2报错问题,介绍如何下载并安装包含ASP.NET Core IIS Module的Windows Hosting Bundle,确保.NET Core和ASP.NET Core运行时正确配置。
2万+

被折叠的 条评论
为什么被折叠?



