如何在Classic ASP中设置断点? (IIS7 / VS2010)

时间:2021-10-10 01:59:13

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.

我有一个混合的ASP.NET /经典ASP应用程序,我希望能够在ASP代码中设置断点。这可能吗?使用VS2010 Ultimate在Win7上运行IIS7。

4 个解决方案

#1


12  

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

在VBScript中,Stop语句可用于触发断点。

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.

我假设这是您要调试的本地IIS7实例。在我的计算机上,当我尝试加载具有Stop语句的示例页面时,我获得了Visual Studio即时调试器弹出窗口。您需要提供管理权限才能调试页面。

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.

您可能还需要在IIS管理器中的“ASP”小程序中启用服务器端调试,但刚刚检查时,我的计算机上的服务器端调试设置为False。


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

如果您不介意使用管理员权限(或已经执行)运行Visual Studio,那么您还可以尝试以下操作:

  1. Use the "File -> Open Web Site..." command to open the site (under the "Local IIS" section).
  2. 使用“文件 - >打开网站...”命令打开该站点(在“本地IIS”部分下)。
  3. From the Solution Explorer, open the files you want to debug and set breakpoints.
  4. 在Solution Explorer中,打开要调试的文件并设置断点。
  5. Start the debugger by selecting the "Debug -> Attach to Process..." menu item. Select the "w3wp.exe" process.
  6. 选择“Debug - > Attach to Process ...”菜单项启动调试器。选择“w3wp.exe”进程。
  7. Now when you try to load a page in your browser, Visual Studio will stop at any breakpoints.
  8. 现在,当您尝试在浏览器中加载页面时,Visual Studio将在任何断点处停止。

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.

另请注意,如果对页面进行更改,则更改将保存到磁盘。在工作中,我以这种方式使用VS2005作为经典ASP的主编辑,正是因为我可以轻松设置断点。


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.

我还没有尝试过的第三个选项可能是最近发布的IIS Express。它应该是专为没有完全管理员权限的开发人员设计的,因此调试可能不需要提升提示。如果我有机会在接下来的几天内试一试,我会更新我的答案。

#2


1  

response.write("my value....")
response.end
;)

#3


0  

I've run into this situation a few times. This summarizes the "typical suspects". If you know of more, then please add an edit or comment.

我曾经遇到过这种情况。这总结了“典型的嫌疑人”。如果您了解更多信息,请添加编辑或评论。

  1. Ensure web.config has debug="True"

    确保web.config有debug =“True”

  2. Ensure that you are attaching to the correct w3wp.exe process

    确保您附加到正确的w3wp.exe进程

  3. Ensure that the App Pool configuration that is associated with this site in IIS has Maximum Worker Processes set to 1 (found in the Process Model section).

    确保IIS中与此站点关联的App Pool配置将Maximum Worker Processes设置为1(可在Process Model部分中找到)。

  4. Ensure that the ASP configuration for the site in IIS allows Client and Server debugging (found in the Debugging Properties section).

    确保IIS中站点的ASP配置允许客户端和服务器调试(可在“调试属性”部分中找到)。

  5. Ensure that machine.config does not have retail="True" in the deployment tag. The default for this attribute is false, which will permit debugging.

    确保machine.config在部署标记中没有retail =“True”。此属性的默认值为false,这将允许调试。

-- ss

- ss

#4


0  

I am not sure anyone faced this issue or not. i have a asp.net and classic ASP mix application on IIS 7.5 with VS2010. I was following all the necessary steps to debug classic ASP, but no luck. Finally found that when we W3wp.exe was automatically getting attached and by default it gets attached with option "Automatically determine the type of code to debug" and I think in that option it was determining only managed code, not script. I changed it to explicitly select the type of code to debug and selected "Script".. and wow it worked.

我不确定是否有人遇到过这个问题。我在IIS 7.5和VS2010上有一个asp.net和经典的ASP混合应用程序。我正在按照调试经典ASP的所有必要步骤,但没有运气。最后发现,当我们W3wp.exe自动获得附加时,默认情况下会附加选项“自动确定要调试的代码类型”,我认为在该选项中它只确定托管代码,而不是脚本。我改变它以明确选择要调试的代码类型并选择“脚本”..并且哇它工作。

One more thing it does not allowed me to select managed code and script together.

还有一件事它不允许我一起选择托管代码和脚本。

#1


12  

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

在VBScript中,Stop语句可用于触发断点。

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.

我假设这是您要调试的本地IIS7实例。在我的计算机上,当我尝试加载具有Stop语句的示例页面时,我获得了Visual Studio即时调试器弹出窗口。您需要提供管理权限才能调试页面。

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.

您可能还需要在IIS管理器中的“ASP”小程序中启用服务器端调试,但刚刚检查时,我的计算机上的服务器端调试设置为False。


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

如果您不介意使用管理员权限(或已经执行)运行Visual Studio,那么您还可以尝试以下操作:

  1. Use the "File -> Open Web Site..." command to open the site (under the "Local IIS" section).
  2. 使用“文件 - >打开网站...”命令打开该站点(在“本地IIS”部分下)。
  3. From the Solution Explorer, open the files you want to debug and set breakpoints.
  4. 在Solution Explorer中,打开要调试的文件并设置断点。
  5. Start the debugger by selecting the "Debug -> Attach to Process..." menu item. Select the "w3wp.exe" process.
  6. 选择“Debug - > Attach to Process ...”菜单项启动调试器。选择“w3wp.exe”进程。
  7. Now when you try to load a page in your browser, Visual Studio will stop at any breakpoints.
  8. 现在,当您尝试在浏览器中加载页面时,Visual Studio将在任何断点处停止。

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.

另请注意,如果对页面进行更改,则更改将保存到磁盘。在工作中,我以这种方式使用VS2005作为经典ASP的主编辑,正是因为我可以轻松设置断点。


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.

我还没有尝试过的第三个选项可能是最近发布的IIS Express。它应该是专为没有完全管理员权限的开发人员设计的,因此调试可能不需要提升提示。如果我有机会在接下来的几天内试一试,我会更新我的答案。

#2


1  

response.write("my value....")
response.end
;)

#3


0  

I've run into this situation a few times. This summarizes the "typical suspects". If you know of more, then please add an edit or comment.

我曾经遇到过这种情况。这总结了“典型的嫌疑人”。如果您了解更多信息,请添加编辑或评论。

  1. Ensure web.config has debug="True"

    确保web.config有debug =“True”

  2. Ensure that you are attaching to the correct w3wp.exe process

    确保您附加到正确的w3wp.exe进程

  3. Ensure that the App Pool configuration that is associated with this site in IIS has Maximum Worker Processes set to 1 (found in the Process Model section).

    确保IIS中与此站点关联的App Pool配置将Maximum Worker Processes设置为1(可在Process Model部分中找到)。

  4. Ensure that the ASP configuration for the site in IIS allows Client and Server debugging (found in the Debugging Properties section).

    确保IIS中站点的ASP配置允许客户端和服务器调试(可在“调试属性”部分中找到)。

  5. Ensure that machine.config does not have retail="True" in the deployment tag. The default for this attribute is false, which will permit debugging.

    确保machine.config在部署标记中没有retail =“True”。此属性的默认值为false,这将允许调试。

-- ss

- ss

#4


0  

I am not sure anyone faced this issue or not. i have a asp.net and classic ASP mix application on IIS 7.5 with VS2010. I was following all the necessary steps to debug classic ASP, but no luck. Finally found that when we W3wp.exe was automatically getting attached and by default it gets attached with option "Automatically determine the type of code to debug" and I think in that option it was determining only managed code, not script. I changed it to explicitly select the type of code to debug and selected "Script".. and wow it worked.

我不确定是否有人遇到过这个问题。我在IIS 7.5和VS2010上有一个asp.net和经典的ASP混合应用程序。我正在按照调试经典ASP的所有必要步骤,但没有运气。最后发现,当我们W3wp.exe自动获得附加时,默认情况下会附加选项“自动确定要调试的代码类型”,我认为在该选项中它只确定托管代码,而不是脚本。我改变它以明确选择要调试的代码类型并选择“脚本”..并且哇它工作。

One more thing it does not allowed me to select managed code and script together.

还有一件事它不允许我一起选择托管代码和脚本。