Saturday, 23 October, 2004

I have learnt a new trick this week that I probably should have known a long time before now and that's how to attach the Visual Studio 2003 debugger to an ASP page.

Configuration

Before we can debug ASP using Visual Studio we have to a little configuration. This involves two steps:

  1. Add the IWAM_[blah] is added to the Debug Users security group.
  2. Ensure that server side debugging is switched on for the web application or server in question.

You can perform step two in IIS by right clicking on the web application and selecting properties. When the new window appears select the "home directory" tab and click the configuration button. In another new window that appears select the "debugging" tab and then ensure that the "Enable ASP server-side script debugging" checkbox is checked.

Attaching the debugger

This is fairly straight-forward. Open the page you want to debug in Visual Studio and just click "Tools" then select "Debug Processes" off the menu. In the new window that appears you will see a list of processes. Look down the list and choose the process with the title that starts with: "Microsoft Active Server Pages". Click "Attach" and that will close the dialog and return you Visual Studio but it will now be in run mode.

You can do all the normal stuff you can do with an ASP.NET web application such as set break points, use the locals windows etc. All in all its made debugging ASP application as easy as ASP.NET which is great!

Simon

15:11:12 GMT | #Programming | Permalink
XML View Previous Posts