By default, IIS (Internet Information Services) is configured to hide detailed error messages from remote users for security reasons. Instead of seeing your specific code error or stack trace, you may see a generic page stating "500 - Internal server error."
To debug your application (whether it is ASP.NET or Classic ASP) and see the actual error details directly in your browser, you can temporarily enable detailed errors in your web.config file.
web.config file. (If it doesn't exist, create a new file named web.config).Paste or modify the code below. This configuration covers both ASP.NET and Classic ASP.
<configuration>
<system.webServer>
<!-- 1. Tells IIS to send detailed errors to the browser (For all apps) -->
<httpErrors errorMode="Detailed" />
<!-- 2. Specific setting to show line numbers in Classic ASP -->
<asp scriptErrorSentToBrowser="true" />
</system.webServer>
<system.web>
<!-- 3. Tells ASP.NET to show detailed stack traces -->
<customErrors mode="Off" />
</system.web>
</configuration>
Do not leave these settings enabled in a production environment! Detailed error messages can reveal sensitive information about your server's file structure and code logic to hackers. Once you have fixed the bug, remember to revert these settings or delete the web.config file if you created it solely for debugging.