如何在Classic ASP中设置断点? (IIS7 / VS2010) [英] How can I set breakpoints in Classic ASP? (IIS7/VS2010)

查看:314
本文介绍了如何在Classic ASP中设置断点? (IIS7 / VS2010)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

解决方案

在VBScript中, 停止 语句可用于触发断点

  Response.Writea line
Stop
Response.Write断点后的一行

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



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






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


  1. 使用文件 - >打开网站...命令打开网站(在本地IIS部分)。

  2. 从解决方案资源管理器中,打开要调试的文件并设置断点。

  3. 通过选择调试 - >附加到进程...菜单项启动调试器。选择w3wp.exe进程。

  4. 当您尝试在浏览器中加载页面时,Visual Studio将在任何断点停止。



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






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


      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.

      解决方案

      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.

      这篇关于如何在Classic ASP中设置断点? (IIS7 / VS2010)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆