How do you debug classic ASP?

I have to debug a classic asp site being served by IIS 7 (windows 2008).

How can I do this? I have only worked with ASP.NET.


Solution 1:

From an MSDN blog post: http://blogs.msdn.com/mikhailarkhipov/archive/2005/06/24/432308.aspx

Here is how to make ASP debugging work:

  1. Enable ASP debugging on the server. (I also added DEBUG verb to the asp extension, but I am not sure if it is required).
  2. Open classic ASP in VS 2005.
  3. Set breakpoint.
  4. View page in browser or run without debugging.
  5. Debug | Attach to Process
  6. Locate IIS ASP worker process (w3wp.exe on IIS6) which exposes x86 and Script and attach as Script.

From eddiegroves comment below:

Regarding Step #1 in IIS7 - IIS > ASP > Compilation > Debugging Properties > Enable Server-side Debugging

Solution 2:

I realize this is old, but thought I'd reply to help others since I was looking something else up.

You can use Visual Studio to debug Classic ASP.

If you're running a local copy of IIS, just attach the debugger to the w3wp.exe process and you can set breakpoints, add variables to watch windows, etc.

If you have more than 1 website, it's helpful to run each in a separate application pool, and you'll be able to identify different w3wp.exe process in the Attach Process window.

Just choose "script" as the debugger type. If you're running IISExpress, then the iisexpress.exe process is the correct one to attach to.