0
votes

I setup a 500-100.asp status code custom error page on a Windows 2019 server, with IIS v10. In the page, I instantiate the Server.GetLastError() method. The values returned are all NULL, 0, -1, or just empty, as in the following output:

ASPCode: 
Number: 0
Source: 
Category: 
File: 
Line: 0
Column: -1
Description: 

Server.GetLastError() should still be supported, and in fact, will work if the "Edit Feature Setting..." menu item is used to specify the same relative file path as setup initially, and the "Custom error pages" changed to "Detailed errors." However, then all other custom error pages already defined, will execute twice.

Please note that I found a similar question for this problem (here on Stackoverflow) titled as follows: "Turning off IIS8 Custom Errors for Classic ASP - Potenial bug in IIS?" However, it is for IIS 8.0, and the person who wrote the accepted answer, said he did not remember exactly how to fix the issue.

1

1 Answers

0
votes

This has been resolved. Turns out that what I had to do was simply use the "Add" action in the Error Pages area in IIS-10, and create a new entry, using 500.100 as the Status Code type. This worked perfectly. Now the Server.GetLastError() method returns values as it is supposed to, and none of the other customer error pages execute twice (see stackoverflow.com/q/61627238/692942 question for more information). This was not an easy one to resolve, so I sincerely hope that this helps others who are having the same issue.