How to enable classic ASP debugging on IIS 10. Get 500 Internal server error no matter what...

Mattias Nordin 1 Reputation point
2022-11-05T19:55:29.797+00:00

How to enable classic ASP debugging. No matter what setting I use in Site > ASP > Debugging properties... I get 500 error in my webbrowser (chrome).

257502-image.png

Internet Information Services
Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
13,133 questions
{count} votes

7 answers

Sort by: Most helpful
  1. MotoX80 33,996 Reputation points
    2022-11-05T21:40:27.973+00:00

    Open ASP at the server level (not at the site) and enable "Log errors to NT log". Then check the Application eventlog for the error.

    Log Name: Application
    Source: Active Server Pages
    Date: 11/5/2022 4:35:58 PM
    Event ID: 9
    Task Category: None
    Level: Warning
    Keywords: Classic
    User: N/A
    Computer: Test10
    Description:
    Warning: File /test.asp Line 23 Include file not found. The include file 'common.inc' was not found..

    You should also see the error in the IIS log.

    2022-11-05 20:34:11 192.168.1.5 GET /test.asp |23|ASP_0126|Include_file_not_found 80 - 192.168.1.4 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/107.0.0.0+Safari/537.36+Edg/107.0.1418.26 - 500 0 0 266

    If you want the error to be displayed to the client then I believe that you would need to implement a custon 500-100 error page.

    https://ponderingthought.com/2008/12/20/custom-errors-error-pages-500-100-asp-classic-asp-and-iis-7-0/

    0 comments No comments

  2. Mattias Nordin 1 Reputation point
    2022-11-06T07:42:07.363+00:00

    Will test that. Thanks

    0 comments No comments

  3. Mattias Nordin 1 Reputation point
    2022-11-07T08:51:51.683+00:00

    Please teach me =)
    The following ASP file works and return 8 as expected. No matter if i run in on localhost or via its fully qualified domain name.

    asp.asp
    <hr>
    <%= 4+4 %>

    However, if I run something that throws an error, like:

    asp.asp
    <hr>
    <%= 4+4xxx %>

    I get different results if I am running the page from differnet URL.

    If I run the file from http://localhost/asp.asp on the server I get my expected error message in my browser:

    Microsoft VBScript compilation error '800a03ee'

    Expected ')'

    /asp.asp, line 3

    Response.Write(4+4xxx)
    ------------------^

    However, all external clients get

    500 - Internal server error.
    There is a problem with the resource you are looking for, and it cannot be displayed.

    Is it at all possible to enable script errors to be sent to the browser and not only the Event viewer log?

    Thanks =)

    0 comments No comments

  4. Mattias Nordin 1 Reputation point
    2022-11-07T09:31:24.087+00:00

    Found how to do this. Wrote an summary of the problem and how it was solved.
    Im used to an older IIS server that default sent error messages to external web browsers. In iis10 you have the option to send detailed error messages to external clients (this overrides "Send error message to client = true") or not.

    This can be changed in the IIS > Site > Error pages > 500 > Edit feature setting {change to Detailed Errors}

    Summary:
    https://docs.google.com/document/d/130fS31dubPt7ZFJWyoOBEpeRMea_g_ix5EbUECog1w0/edit#heading=h.6552tq8wbo7b

    0 comments No comments

  5. MotoX80 33,996 Reputation points
    2022-11-07T14:55:10.897+00:00

    I believe that the reason for that is so that hackers on the internet aren't accidently able to see portions of source code when an error occurs. You would need to follow the link that I posted and implement a custom error page to process 500 errors.

    Most errors can be trapped in code like this.

    <html>  
    <body>  
    <h2>ASP Demo</h2>  
    <p id="demo">  
    <%  
    	response.write "Adding 2 numbers.<br><br>"  
    	x = 4  
    	y = 4   
    	total = x + y   
    	response.write "The total is " & total & ".<br><br>"  
    	  
    	response.write "Bad code example.<br><br>"  
    	on error resume next   
    	x = 4  
    	y = "xxx"   
    	total = x + y  
    	if err.number <> 0 then  
    		response.write "That didn't work. <br>"  
    		response.write "Number = " & err.number & " <br>"  
    		response.write "Description = " & err.description & " <br>"  
    	else   
    		response.write "The total is " & total & ".<br><br>"  
    	end if   
    	  
      
    %>  
    </p>  
    </body>  
    </html>  
    

    My recommendation would be to NOT write ASP code. Install the free Visual Studio Community edition and write ASPX code. With VB.Net you can use the Try/Catch notation to handle errors. The intellisense and code samples of the VS IDE will make programming easier.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.