Click here to Skip to main content
15,868,141 members
Articles / Programming Languages / VBScript
Article

Debugging Classic ASP ( VBScript ) in Visual Studio 2008

Rate me:
Please Sign up or sign in to vote.
4.56/5 (14 votes)
23 Aug 2008CPOL2 min read 317.7K   47   29
Step by step guide on how to set up your project so you can debug a site written in Classic ASP VBScript using Visual Studio 2008

Introduction

This is a step by step guide on how to set up your project so you can debug a site written in classic ASP VBScript using Visual Studio 2008.

Using the Code

I walk you step by step through how to set up your project so you can debug a site written in classic ASP VBScript using Visual Studio 2008.

1.1 Setup IIS

1.1.1 Configure Default IIS web site on a local machine to point to the directory the Classic ASP web site is in and turn on ASP server side debugging:

iis-enable-asp-server-side-debugging.gif

1.2 Setup Project in Visual Studio 2008

Since we're talking "classic ASP" written in VBScript, you'll already have a web site. So I'll cover opening an existing site.

1.2.1 Launch Visual Studio 2008

1.2.2 File >> Open >> Web Site

1.2.3 Navigate to the directory that contains the ancient code you have to work with, select it and it opens.

1.2.4 Right click the web site in Solution Explorer

1.2.5 Go to Properties >> Start Options

1.2.6 Configure it to use custom server with Base URL of http://localhost

vs2008-start-options.gif

1.3 Start Debugger

1.3.1 Run application (F5)

1.3.2 Select Visual Studio 2008 as your debugger of choice

1.3.3 Attach to dllhost.exe

attach-to-dllhost.gif

1.3.4 Your browser launches

1.3.5 A new instance of Visual Studio launches

1.3.6 Close the new instance of Visual Studio but leave the browser open.

1.3.7 In the instance of Visual Studio that you opened the web site in, click Debug >> Attach to Process

1.3.8 Check Show process from all users

1.3.9 Select entry for dllhost.exe with type Script, T-SQL, x86

1.3.10 Click Attach

debug-attach-to-process.gif

1.3.11 Just to make sure things are in working order, set a break point at the beginning of your code and click refresh on the browser that was launched when you clicked F5.

1.3.12 Send me a nice thank you.

1.4 Restart Debugging Browser

You will need to reattach to the debugger process if you close the browser.

1.4.1 Hit F5 to launch a new browser window with your application in it. If it acknowledges your breakpoints, then never mind, you're already in business. If not then....

1.4.2 With the browser window still open back in Visual Studio, simply click Debug and then Attach to Process in the drop down menu.

1.4.3 Select entry for dllhost.exe with type Script, T-SQL, x86

1.4.4 Click Attach

1.4.5 Click refresh in the browser F5 launch and Bob's your uncle you're back in business.

History

  • 23rd August, 2008: Initial post 

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Unknown
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
Questiona "Stop" instruction. Pin
Emmet M6-Aug-13 10:04
Emmet M6-Aug-13 10:04 
QuestionNot working with Visual Studio 2010 & XP Pin
DBLWizard22-Feb-13 5:24
DBLWizard22-Feb-13 5:24 
QuestionTry this too, macro method Pin
awilbourn3-Sep-12 1:30
awilbourn3-Sep-12 1:30 
GeneralMy vote of 5 Pin
Manoj Kumar Choubey1-Apr-12 21:41
professionalManoj Kumar Choubey1-Apr-12 21:41 
QuestionChange location of VWDWebCache Pin
stillmc6-Jul-11 5:58
stillmc6-Jul-11 5:58 
GeneralMy vote of 3 Pin
Sohini Dey2119-Aug-10 0:37
Sohini Dey2119-Aug-10 0:37 
Generalthanks. Worked for Visual Studio 2010. Pin
bnighter12-Aug-10 9:04
bnighter12-Aug-10 9:04 
GeneralMy vote of 5 Pin
vincuo6-Jul-10 5:54
vincuo6-Jul-10 5:54 
GeneralThanks Pin
voavictoriano22-Jan-10 3:04
voavictoriano22-Jan-10 3:04 
QuestionRemote debuging classic ASP? Pin
Joeik8-Dec-09 13:39
Joeik8-Dec-09 13:39 
Really nice article, i have problem with making this work remotely tho. i can attach to right proces but breakpoints are empty. Does anybody have any experience on debuging classic asp remotely from vs2008?
AnswerRe: Remote debuging classic ASP? Pin
faina22-Dec-09 23:52
professionalfaina22-Dec-09 23:52 
AnswerRe: Remote debuging classic ASP? Pin
AlexStevens10-Jun-12 9:58
AlexStevens10-Jun-12 9:58 
GeneralRestart website in iis if you have this error when attaching Pin
pedrogameiropinto29-Jul-09 5:11
pedrogameiropinto29-Jul-09 5:11 
GeneralThis is very cool, but... Pin
PRMan!!!15-Jul-09 7:34
PRMan!!!15-Jul-09 7:34 
GeneralRe: This is very cool, but... Pin
PRMan!!!15-Jul-09 7:56
PRMan!!!15-Jul-09 7:56 
Generalit only worked for a couple of days Pin
opensas29-Jun-09 12:42
opensas29-Jun-09 12:42 
GeneralRe: it only worked for a couple of days Pin
Pavel Shkleinik10-Nov-09 7:13
Pavel Shkleinik10-Nov-09 7:13 
Generalcan't find the correct dllhost.exe entry Pin
cagilbert22-May-09 14:29
cagilbert22-May-09 14:29 
GeneralRe: can't find the correct dllhost.exe entry Pin
cagilbert22-May-09 14:30
cagilbert22-May-09 14:30 
GeneralProblem applying your solution Pin
Tokorie6-Apr-09 19:26
Tokorie6-Apr-09 19:26 
AnswerRe: Problem applying your solution Pin
blborg14-May-09 2:18
blborg14-May-09 2:18 
QuestionHow to set nested application to application within built in web server Pin
joeller3-Mar-09 6:00
professionaljoeller3-Mar-09 6:00 
GeneralThank you!!! Pin
Andrew J Dixon3-Feb-09 12:33
professionalAndrew J Dixon3-Feb-09 12:33 
GeneralImprovements in Visual Studio 2008 Pin
MikeGale18-Oct-08 21:47
MikeGale18-Oct-08 21:47 
GeneralNeed to do it slightly different under Server 2008. Pin
Member 116013619-Sep-08 9:17
Member 116013619-Sep-08 9:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.