Debugging classic ASP web application with Visual Studio 2005

Finally, I got it; after a long and tiring evening of hit and trial I was able to hit a breakpoint in my asp page :)

So you might think how come I suddenly moved from asp.net and Reporting services to classic asp, a long story in short is that right now I am assigned a task to migrate our company's timesheet application from classic asp to asp.net. This is the first time I am working on asp application and in first look application looked like it's from some other world, but somehow I was able to get it working in VS 2005.

Now came the real twist, I was able to access the users page of timesheet but not the admin, every time I tried running any admin page I was redirected to client page. As an asp.net developer for the last 3 years I was so used to debug my application using VS debugger that I just added a breakpoint in application and hit F5(hoping that I will be able to step through the code); but what's this, breakpoints were never hit, no symbols were loaded :(

image

So as you can imagine I just did some hit and trial without any luck. After searching for a while I landed to a few useful links -

http://www.devx.com/tips/Tip/18204

http://msdn.microsoft.com/en-us/library/aa291223(VS.71).aspx

But even after following all these steps nothing happened. Finally I bumped (lucky me) into this thread

Visual Studio 2005 debugging not working for ASP pages

and as author said...VOILA it worked, breakpoint was hit, thank god.

So I just thought to note down steps I followed and what worked.

 1. Enable ASP server-side script debugging in website's configuration properties -

image

 2. Run the application (F5) and then attach to the Dllhost.exe process -

a. Go to Debug->Attach to process menu in VS.

b. Check "Show processes from all users" check box.

c. Select dllhost.exe (Script code, T-SQL code) and click attach.

image

That's it, breakpoints will get hit and you can debug your application.

But still there are some things which are not required but worth mentioning -

 1. Almost in all related articles it was mentioned that you need to enable asp debugging in your asp projects configuration properties, but in my scenario I had added my application as local IIS website and its properties didn't had any such option. Even, It's not required to enable native code Debugger.

image

 2. Its mentioned that you need to add your user account or IWAN_MACHINENAME account to your systems "Debugger Users" group, but I tried it without that and debugging worked perfectly.

image

I guess it was a good start to my new project, learned quite a few new/good things.

Published Wednesday, July 16, 2008 9:34 PM by akjoshi
Filed under: ,

Comments

# re: Debugging classic ASP web application with Visual Studio 2005

Thursday, July 17, 2008 7:11 AM by Javid

Fantastic work man. Working superb.

# re: Debugging classic ASP web application with Visual Studio 2005

Monday, August 11, 2008 2:07 AM by Samir

If you use IIS 7 you should attach to w3wp process instead dllhost.

# re: Debugging classic ASP web application with Visual Studio 2005

Tuesday, November 18, 2008 12:33 AM by Piyush Verma

Great Joshi very useful

# re: Debugging classic ASP web application with Visual Studio 2005

Friday, January 16, 2009 3:50 PM by tekknowledge

good stuff mayne, this took me a month to figure out on my own...wish i would have bumped into your post sooner. 4get response.write and response.end!! =(

# re: Debugging classic ASP web application with Visual Studio 2005

Thursday, March 05, 2009 3:41 PM by Edward Joell

Been there and done all that and debugging is still not working.  It said add IWAM to debuggers group? There is no Debuggers group on this machine.

# re: Debugging classic ASP web application with Visual Studio 2005

Saturday, March 07, 2009 11:16 AM by Omar

This is great stuff. well done mate. Working in classisc asp is very depressing. I also need to migrate an old legacy web application into ASP.NET and step through the old legacy code.

Omar

# dllhost.exe | video and pics about dllhost.exe

Monday, March 09, 2009 3:34 AM by dllhost.exe | video and pics about dllhost.exe

Pingback from  dllhost.exe | video and pics about   dllhost.exe

# dllhost.exe | video and pics about dllhost.exe

Monday, March 09, 2009 3:39 AM by dllhost.exe | video and pics about dllhost.exe

Pingback from  dllhost.exe | video and pics about   dllhost.exe

# re: Debugging classic ASP web application with Visual Studio 2005

Thursday, March 12, 2009 1:39 AM by akjoshi

Thanks everyone

@Samir - Thanks for the information, I am sure it will be helpful to many

@Omar - Yes its really tough to work in Classis ASP specially after working with asp.net; but one positive is that working in ASP helps you understand the real power of asp.net and appreciate it.

# re: Debugging classic ASP web application with Visual Studio 2005

Thursday, March 12, 2009 2:35 AM by akjoshi

Hi Edward,

I am sorry that your comment was not published on time, it was marked as possible spam by system. I am not sure why there's not debuggers group on your machine so can't help you much on that , but will definitely try to add this to post sometime later.

# re: Debugging classic ASP web application with Visual Studio 2005

Tuesday, March 24, 2009 11:51 PM by McFloyd

Thanks, quick, practical, and very useful!!

Leave a Comment

(required) 
(required) 
(optional)
(required)