Last active
January 4, 2024 17:43
-
-
Save fernandezja/494e2448228decca3b5d8c6509a0a7c1 to your computer and use it in GitHub Desktop.
ASP.NET Core / NET 8 Custom HTTP Error Pages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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=".\WebApp1.exe" | |
stdoutLogEnabled="false" | |
stdoutLogFile=".\logs\stdout" | |
hostingModel="inprocess" | |
disableStartUpErrorPage="true" /> | |
<httpErrors errorMode="Custom" defaultResponseMode="File"> | |
<remove statusCode="500" subStatusCode="-1" /> | |
<error statusCode="500" path="500.htm" /> | |
</httpErrors> | |
</system.webServer> | |
</location> | |
</configuration> | |
<!-- | |
aspNetCore > disableStartUpErrorPage = true | |
https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/web-config?#attributes-of-the-aspnetcore-element | |
httpErrors > | |
https://learn.microsoft.com/en-us/iis/configuration/system.webserver/httperrors/ | |
--> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment