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.

22 Comments

Add a Comment

As it will appear on the website

Not displayed

Your website