ASP.NET Core와 500.19, 500.21 오류 (0x8007000d)
ASP.NET Core 응용 프로그램을 배포했는데, 500.19 오류가 발생한다면?
HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.
Detailed Error Information:
Module IIS Web Core
Notification Unknown
Handler Not yet determined
Error Code 0x8007000d
Config Error
Config File \\?\c:\temp\web.config
Requested URL http://localhost:8030/
Physical Path
Logon Method Not yet determined
Logon User Not yet determined
Config Source:
-1:
0:
More Information:
This error occurs when there is a problem reading the configuration file for the Web server or Web application. In some cases, the event logs may contain more information about what caused this error.
예전의 글에서와 비슷한 원인입니다.
IIS - 500.19 오류 (0x8007000d)
; https://www.sysnet.pe.kr/2/0/976
ASP.NET Core Web Application을 IIS에서 호스팅하는 방법
; https://www.sysnet.pe.kr/2/0/11120
결국 web.config에 유효하지 않은 설정을 포함하고 있는 것인데요, 가령 제 경우에는 ASP.NET Core 응용 프로그램에 대한 기본 배포 파일인데도 오류가 발생했습니다.
<?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=".\BlazorSample.exe" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />
</system.webServer>
</location>
</configuration>
<!--ProjectGuid: 2e069c51-17d6-4b15-8ce4-8548947c3752-->
위의 설정에서 <aspNetCore ... /> 설정을 주석 처리해 보면, 오류 메시지가 500.21로 바뀌는데요,
HTTP Error 500.21 - Internal Server Error
Handler "aspNetCore" has a bad module "AspNetCoreModuleV2" in its module list
Most likely causes:
Managed handler is used; however, ASP.NET is not installed or is not installed completely.
There is a typographical error in the configuration for the handler module list.
During application initialization, either the application initialization feature has set skipManagedModules to true, or a rewrite rule is setting a URL that maps to a managed handler and is also setting SKIP_MANAGED_MODULES=1.
Things you can try:
Install ASP.NET if you are using managed handler.
Ensure that the handler module's name is specified correctly. Module names are case-sensitive and use the format modules="StaticFileModule,DefaultDocumentModule,DirectoryListingModule".
Ensure that any application initialization rewrite rules set SKIP_MANAGED_MODULE=0 when setting a URL that maps to a managed handler (such as .aspx, for example.)
As an alternative, ensure that application initialization rewrite rules map the request to an unmanaged handler (for example, to an .htm file, which is mapped to the StaticFileHandler.)
Detailed Error Information:
Module IIS Web Core
Notification ExecuteRequestHandler
Handler aspNetCore
Error Code 0x8007000d
Requested URL http://localhost:8030/
Physical Path c:\temp
Logon Method Anonymous
Logon User Anonymous
More Information:
IIS core does not recognize the module.
즉, AspNetCoreModuleV2 모듈을 로드할 수 없었던 것으로 결국 해당 시스템에 Hosting Bundle 모듈을 설치하는 것으로 해결할 수 있습니다.
.NET Core 3.1
; https://dotnet.microsoft.com/download/dotnet-core/3.1
Hosting Bundle
; https://dotnet.microsoft.com/download/dotnet-core/thank-you/runtime-aspnetcore-3.1.8-windows-hosting-bundle-installer
[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]