Friday, February 8, 2013

Classic ASP debugging


 classic ASP Visual Studio Debuging

1. Classic ASP debugging only works with IIS. It does not work with the VS Development Web Server (Cassini). 
2. In VS 2005 you have to attach to the ASP worker process (w3wp.exe in IIS 6).

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.

At this point breakpoint should bind and you should be able to hit it. You may have to refresh the page in the browser to get the code executed again. I tried on Windows 2003 SP1 Standard Server running IIS 6 and it worked for me. I want to try on XP Pro + IIS 5 next. 

 classic ASP IIS7 Debuging

I just finish configuring IIS7 so as to run my classic ASP pages and these are my settings after some configuration
1) Turn Windows futures on or off under Control Panel\Programs\
Under Internet Information Services > Web Management Tools
  Switch on IIS Management Console/Management Scripts and Tools/Management Service
Under Internet Information Services > World Wide Web Services > Application Developement Features
  Switch on all features
Under Internet Information Services > World Wide Web Services > Common Http features
  Switch on Default Document and Static content (can now see image in iistart.htm welcome page)
Under Internet Information Services > World Wide Web Services > Security
  Switch on Basic Authentication, Request Filtering, and Windows Auhentication
2) Run Internet Information Services (IIS) Manager under Control Panel\System and Maintenance\Administrative Tools
Double click on the ASP icon
Under Behaviour
  Set Enable Parent Paths to True (so as not to change existing ASP code)
Under Debugging Properties
  Set Errors To Browser to True
Save changes
I hope the above helps