How to set breakpoints in classic ASP? (IIS7 / VS2010)

I have a hybrid ASP.NET-class ASP application, and I would like to be able to set breakpoints in ASP code. Is it possible? Launch IIS7 on Win7 with VS2010 Ultimate.

+4
source share
4 answers

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

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

I assume this is a local IIS7 instance that you want to debug. On my computer, when I try to load a sample page with the Stop statement, I get a Visual Studio Just-In-Time Debugger popup. You will need to provide administrative privileges 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 do not mind running Visual Studio with administrator privileges (or are already running), you can also try the following:

  • Use the command "File → Open Website ..." to open the website (in the "Local IIS" section).
  • In Solution Explorer, open the files you want to debug and set breakpoints.
  • Launch the debugger by selecting the menu item "Debugging → Attach to process ...". Select the process "w3wp.exe".
  • 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 in the same way as my editor-in-chief for classic ASP, precisely because I can easily set breakpoints.


A third option that I have not tried yet may be the recently released IIS Express . It should be designed specifically for developers who do not have full administrator rights, so you may not need a promotion invitation for debugging. I will update my answer if I have the opportunity to try it in the next few days.

+12
source
 response.write("my value....") response.end ;) 
+1
source

I have encountered this situation several times. This summarizes the "typical suspects." If you know more, add changes or comments.

  • Make sure web.config has debug = "True"

  • Make sure that you are connecting to the correct w3wp.exe process.

  • Ensure that the application pool configuration associated with this site in IIS has the maximum workflows set to 1 (see the "Process Model" section).

  • Make sure that the ASP configuration for the site in IIS allows you to debug the client and server (located in the "Debug Properties" section).

  • Make sure machine.config does not have the retail = "True" label in the deployment tag. The default value for this attribute is false, which allows debugging.

- ss

0
source

I am not sure if anyone ran into this problem or not. I have asp.net and the classic ASP mix application on IIS 7.5 with VS2010. I followed all the necessary steps to debug classic ASP, but no luck. Finally, it turned out that when we W3wp.exe automatically connected and connected by default with the option "Automatically detect the type of code for debugging", and I think that in this option it determined only the managed code, not the script. I changed it to explicitly select the type of code to debug and selected "Script" .. and nothing worked for myself.

Another thing that does not allow me to choose managed code and script together.

0
source

Source: https://habr.com/ru/post/1337347/


All Articles