Debugging Classic ASP

How wonderful it would be if we only worked on the latest and greatest! But Alas! That is not meant to be.

I’ve been using VS2003 to debug Classic ASP web sites we still support. The ability to insert breakpoints and step through the code has been great.

Recently I decided to use VS2010 to accomplish the same thing and here is what I’ve found out so far.

Visual Studio 2010 Splash Screen

I complicated my life a little bit more 🙂

Looking around the web I found various articles that discussed the steps to accomplish said debugging.

The first thing you need to do is make sure your classic ASP site is set as the default web site in your local IIS. The built in web server will not work with classic ASP sites.

Setting it up the classic ASP site as the default website was kind of odd for me. Since that’s not how we did it when using VS2003. We would have a normal local website and just open it using VS2003.

Well it was not that easy, you would create a new project add all the folders and files to it and then run it. That has not changed, it’s just that now the website you are debugging is at the top of the hierarchy in your local IIS.
Internet Information Server Properties Window

It is also important that you click on your Configuration button for the site:

Once you’re there, click on the Debugging tab and check Enable ASP server-side script debugging as well as client-side script if you need to.

Application Configuration Window

Make sure you apply, click Ok on the previous screen and you’re site is ready to be debugged.

But if you hit the start debugging button or press F5, you’ll get all sort of nasty errors.

What you have to do is view in browser first. That’s Ctrl+Shift+W or click the View in Browser icon:

You can get to Ctrl+Shift+W through the keyboard, the icon or under the File -> View In Browser menu item. This will start your website on your browser, running on your local IIS.

You are of course not done yet. You must attach to the process. And you do that by clicking on the menu item Debug -> Attach to Process, or menu item Tools -> Attach to Process or keyboard combination of Ctrl+Alt+P.

There was a write up back in 2006 for VS2005 here: Attaching to Process

It even has some code to create a macro to bypass this Ctrl+Umpteen+More madness!

Finally stepping through code in all it’s glory in Classic ASP:

Stepping through ASP code.

Classic ASP lives on!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: