Debugging VBScript / ASP pages in the year 2017, with Visual Studio 2015 (VS2015)

Ah, another year and I still need to debug VBScript code in ASP pages. I had hoped to forget how to do this and I did, but then I needed to do it again so I had to go “remember” / Google how to do it again. I’m kind of amazed that I can debug this stuff in VS2015 and of course I’m putting this all on here so that when I forget again I won’t have to search very far to find the information.

I was doing this on Windows 2008 with the full version of IIS, so YMMV with other versions of Windows. This also assumes you are an Administrator on the box. In my case this was a DEV/QA VM I was using so my account had administrative privileges.

First make sure you have ASP installed on your box by going into Roles under Server Manager and adding the ASP Role Service under Application Development.

Once this is done you might need to reset IIS and also reload the IIS Manager snap-in if you already had it open. I noticed the ASP option for the website did not appear until I reloaded the snap-in.

Navigate to your website in IIS Manager and in the center pane look for ASP under the IIS heading. Double click on that option to open the feature menu.

Expand the Debugging Properties section by clicking on the + next to it.

From there you will likely want to flip the option for “Enable Server-side Debugging” to True at the least. I flipped “Enable Client-side debugging” to true as well as I could not recall if some VBScript was used in that fashion in my ancient app.

Once that is all done you are ready to rock and roll with VS2015. For an ASP site what you will want to do is open up a new instance of VS2015. Then you will use the File – Open – Web Site option which takes you to a view of your local IIS. Your ASP site or app will need to be installed in there. Find your site/app and open it up and it will load up the structure of your site in the Solution Explorer.

At this point you should run your site in the browser so that IIS starts up. Use Debug – Attach To Process and choose the W3WP process (different process on certain versions of Windows) making sure that you are debugging using “Script Code” otherwise you will get nothing.

Set some breakpoints in your code and you should see results!

Leave a Reply

Your email address will not be published. Required fields are marked *