Debugging a Global.asa file differs from debugging .asp files in these ways:
Before you can debug script in the Global.asa file, you must enable debugging for ASP pages. You can manually enable debugging for your ASP application as described under "Enabling ASP Debugging on the Server" in the Troubleshooting topic. Alternatively, Visual InterDev can automatically enable debugging on the server as needed.
To automatically enable script debugging in ASP pages
When this option is set, each time you start a debugging session Visual InterDev checks that the server is configured for debugging. This includes:
Note You can perform the first two steps manually on the server. For details, see "Enabling ASP Debugging on the Server" in the Troubleshooting topic.
When you quit your debugging session, Visual InterDev restores the server debugging settings and out-of-process setting to their previous values.
To debug the Global.asa file, you set up a debugger call from script in the file, and then start an ASP application.
To call the debugger from the Global.asa file
–or–
Include a statement that starts the debugger explicitly, such as Stop
in VBScript or debugger
in JavaScript. Place the statement at the beginning of the procedure, before any statements that you will want to step through.
If there is an error in a Global.asa file (either a syntax error or run-time error), the server stops the procedure containing the error. If debugging is enabled for that ASP application, the server prompts you to start the debugger and displays an error message. If debugging is not enabled for the ASP application, an error message is sent to the client browser. In either case, the procedure containing the error stops.
Note If a debugger is installed on the server computer, the server does not pass error information through to the client. Instead, it displays an error message on the server computer's monitor. For more information, see "Just-In-Time Debugging of Server Pages" in the Troubleshooting topic.
You can launch the debugger in response to an error or debugger statement only if just-in-time debugging is enabled.
To enable just-in-time debugging
To debug Global.asa script in response to an error
The Global.asa file is loaded into the editor. If necessary, get a working copy of the page. If the project was already open, the Global.asa file is loaded as read-only file in the new project.
If server debugging is not enabled for the application, errors are displayed in the browser as text in the page. In that case, open the project containing the page in Visual InterDev and start the debugger there, as described above.
You cannot stop and restart the script by refreshing a Global.asa file. To rerun Application_OnStart or Session_OnStart procedures, you must refresh the file or trigger the events again or otherwise restart the application.
To rerun all procedures in the Global.asa file
–or–
This restarts the application and session, which runs the procedures in the Global.asa file again.