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

Saturday, March 7, 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

# 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

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

Thanks, quick, practical, and very useful!!

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

Tuesday, December 29, 2009 2:14 AM by nitin

This blog is very useful. My problem was resolved..thanks a lot

cheers

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

Thursday, April 8, 2010 2:19 AM by kannabirank

Hi,

DLLHOST is not listed in the "Attach to process" window. Do you know how to find it.

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

Thursday, April 8, 2010 11:27 AM by Nik

What if dllhost.exe has no Script listed in Type column? It has just T-SQL and x86. What may be the reason for missing "Script"? Attaching in this case after manually selecting "Script" option results in "Unable to attach." error.

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

Wednesday, June 9, 2010 3:03 AM by Nick

Thanks, that was a lifesaver! It did not work straight away for me though, but after reading the comment above about IIS7, I tried connecting to the w3wp process instead of dllhost, and hit success (note that I have no idea how to verify the version of IIS I'm running, but who cares, it works :-)).

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

Thursday, August 19, 2010 10:24 AM by freeborn5

What if the Classic ASP calls a VB DLL ??

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

Saturday, August 28, 2010 5:56 AM by Matt

I had to give the IWAN_MACHINENAME permission on the local directory where the website was stored as this was outside the inetpub/wwwroot folder structure. Then worked perfectly.

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

Thursday, September 9, 2010 10:13 AM by Paul Scannell

I hope it isn't too late to ask a question on this two year old page, but here goes:

How do you make your loosely coupled .asp and .inc pages come through as a project or solution?  This wonderful tutorial starts out with that part already in place, apparently.

My eMail address is: PaulGScannell@verizon.net

Thanks,

Paul

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

Thursday, November 11, 2010 11:14 AM by Sab

I follow all the step mention above.I m using IIS7 so i attach process to w3wp process instead dllhost.But i can't put the break point in my code.So can anybody tell me what is wrong.

Thanks

Sab

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

Thursday, November 25, 2010 9:21 AM by Ravi Shankar

How to do the same in VS 2008 SP1 ? plz tell it is urgent.

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

Tuesday, March 1, 2011 4:42 PM by Asim

Thanks! I was trying it for so long

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

Monday, March 21, 2011 6:44 AM by Srinivasa Sarma

Thanks dude..It is really helpful. I was looking for this from long time :)

Thanks again

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

Friday, April 15, 2011 10:36 AM by Pablo

Make sure you tick the "Show processes from all users" checkbox at the bottom-left of the "Attach to process" dialog as shown in the picture in step 2 above!

The DLLHOST process is usually be run by the asp application user (the one with your machine name and "IWAM" in it...) I think it depends on the way your asp app authenticates, but if you don't see DLLHOST in the list this is probably the case.

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

Monday, June 6, 2011 2:43 PM by Lok

This article is very helpful. Great work. Thanks.

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

Wednesday, June 22, 2011 11:19 AM by Jorge Estrada

Necesito ayuda.

tenia una aplicacion hecho en asp.net y mi maquina estaba con sistema operatiov WINDOWS XP, pero ahora me instalaron windows 7 y no me funciona al dar f5 no se me ejecata...............

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

Wednesday, November 9, 2011 4:35 AM by Rajeev Kumar K R

Thanks.. this was very helpfull for me.. great!!

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

Monday, August 13, 2012 9:09 AM by akjoshi

@Angelo - Thanks Angelo, this looks really useful; but unfortunately it's not free.

Leave a Comment

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