Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I set breakpoints in Classic ASP? (IIS7/VS2010)

I have a hybrid ASP.NET/classic ASP application and I'd like to be able to set breakpoints in the ASP code. Is this possible? Running IIS7 on Win7 with VS2010 Ultimate.

like image 525
3Dave Avatar asked Dec 07 '22 23:12

3Dave


2 Answers

In VBScript, the Stop statement can be used to trigger a breakpoint.

Response.Write "a line"
Stop
Response.Write "a line after the breakpoint

I'm assuming that this is a local IIS7 instance that you want to debug. On my computer, when I try to load a sample page that has a Stop statement, I get the Visual Studio Just-In-Time Debugger popup. You will need to provide administrative privileges in order to debug the page.

You may also need to enable server-side debugging in the "ASP" applet in IIS Manager, but when I checked just now, server-side debugging was set to False on my machine.


If you don't mind running Visual Studio with admin privileges (or already do), then you can also try the following:

  1. Use the "File -> Open Web Site..." command to open the site (under the "Local IIS" section).
  2. From the Solution Explorer, open the files you want to debug and set breakpoints.
  3. Start the debugger by selecting the "Debug -> Attach to Process..." menu item. Select the "w3wp.exe" process.
  4. Now when you try to load a page in your browser, Visual Studio will stop at any breakpoints.

Also note that if you make changes to the pages, the changes will be saved to disk. At work, I use VS2005 this way as my main editor for classic ASP, precisely because I can set breakpoints easily.


A third option that I haven't tried yet might be the recently released IIS Express. It's supposed to be designed specifically for developers who don't have full admin privileges, so maybe debugging won't require an elevation prompt. I'll update my answer if I get a chance to try it out in the next few days.

like image 60
Cheran Shunmugavel Avatar answered Feb 12 '23 23:02

Cheran Shunmugavel


response.write("my value....")
response.end
;)
like image 33
eloycm Avatar answered Feb 13 '23 00:02

eloycm