IIS Express 是否支持调试经典 ASP?

发布于 2024-10-08 23:01:32 字数 361 浏览 0 评论 0原文

我最近安装了 Visual Studio 2010 SP1 BETAASP.NET MVC 3 RC2IIS Express

我成功地在使用 IIS Express 的项目中与经典 ASP 页面一起运行了一个 MVC 3 项目

我想知道是否有一种方法可以在使用 IIS Express 时在 Visual Studio 中使用断点设置经典 ASP 调试

如果是这样,是否有任何关于如何执行此操作的教程/帖子?

I recently installed Visual Studio 2010 SP1 BETA, ASP.NET MVC 3 RC2 and IIS Express.

I successfully got an MVC 3 project running along with classic ASP pages in the project with IIS Express.

I was wondering if there is a way to set up Classic ASP debugging with breakpoints in Visual Studio while using IIS Express?

If so, are there any tutorials / posts on how to do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

指尖微凉心微凉 2024-10-15 23:01:32

要在 IIS Express 中启用 ASP 调试:

1. 根据您的 Visual Studio 版本找到要更新的相应 applicationhost.config 文件。

  • Visual Studio 2015 及更高版本:每个 Web 应用都有自己的 applicationhost.config 文件,您需要修改该文件。每个文件都位于{解决方案目录}\.vs\config(请记住,.vs 是一个隐藏文件夹)
  • 在 Visual Studio 2015 之前:您可以为所有文件启用调试通过修改 %USERPROFILE%\Documents\IISExpress\config 中的 applicationhost.config 来启动 Web 应用程序

(如果找不到 applicationhost.config,那是因为 Web 应用程序尚未在 IISExpress 中启动。所以请转到首次启动您的应用程序,然后将创建该文件。)

2. 在文本编辑器中打开 applicationhost.config 并更改 ; 元素:

<asp scriptErrorSentToBrowser="true" enableParentPaths="true" bufferingOn="true" errorsToNTLog="true" appAllowDebugging="true" appAllowClientDebug="true">
    <cache diskTemplateCacheDirectory="%TEMP%\iisexpress\ASP Compiled Templates" />
    <session allowSessionState="true" />
    <limits />
</asp>

开始调试:

  1. 启动网站不进行调试
  2. 在 Visual Studio 中,打开“附加到进程”对话框。
  3. 附加到更改为脚本
  4. 选择 iisexpress.exe 并单击“附加”。

设置断点:

  1. 调试后,使用浏览器浏览到要调试的页面。 (是的,在设置任何断点之前。)
  2. 返回到 VS,转到解决方案资源管理器,您将看到一个“脚本文档”节点,其中列出了 IIS Express 缓存的文件。 展开此节点直到找到需要断点的 .asp 页面。 (在您按照上一步浏览到该页面之前,该页面不会出现在此列表中。)
    在此处输入图像描述
  3. 打开文件并在此处设置断点(不 原始源文件)。
  4. 刷新或重新导航到页面以命中断点。

请记住,如果您需要对此页面进行更改,请在原始源文件中进行更改,而不是在带有断点的版本中进行更改。当您保存这些更改时,文件将从 IIS Express 缓存中删除,因此您必须重复这些步骤才能再次设置断点。

有关更多详细信息,请参阅 Dixin 的博客

To enable ASP debugging in IIS Express:

1. Locate the appropriate applicationhost.config file to update based on your version of Visual Studio.

  • Visual Studio 2015 and later: Each web app has its own applicationhost.config file that you need to modify. Each file is located in {solution directory}\.vs\config (Keep in mind .vs is a hidden folder)
  • Before Visual Studio 2015: You can enable debugging for all web apps by modifying applicationhost.config located in %USERPROFILE%\Documents\IISExpress\config

(If you cannot find applicationhost.config, it is because the web app has not been launched in IISExpress yet. So go ahead and launch your app for the first time and then the file will be created.)

2. Open applicationhost.config in a text editor and change the <system.webServer><asp> element to:

<asp scriptErrorSentToBrowser="true" enableParentPaths="true" bufferingOn="true" errorsToNTLog="true" appAllowDebugging="true" appAllowClientDebug="true">
    <cache diskTemplateCacheDirectory="%TEMP%\iisexpress\ASP Compiled Templates" />
    <session allowSessionState="true" />
    <limits />
</asp>

Start debugging:

  1. Start the web site without debugging.
  2. In Visual Studio, open the "Attach to Process" dialog.
  3. Change Attach to to Script.
  4. Select iisexpress.exe and click Attach.

To set breakpoints:

  1. Once you are debugging, use your browser to browse to the page you want to debug. (Yes, before you set any breakpoints.)
  2. Return to VS, go to Solution Explorer, and you'll see a "Script Documents" node that lists the files cached by IIS Express. Expand this node until you find the .asp page that needs the breakpoints. (The page won't appear in this list until you have browsed to it per the previous step.)
    enter image description here
  3. Open this file and set breakpoints here (not the original source file).
  4. Refresh or re-navigate to the page in order to hit the breakpoints.

Keep in mind that if you need to make changes to this page, make them in the original source file, not the version with the breakpoints. And when you save those changes the file is removed from the IIS Express cache so you have to repeat these steps to set the breakpoints again.

For more details see Dixin's Blog.

暗地喜欢 2024-10-15 23:01:32

令人惊讶的是,与 Cassini 不同,IIS Express 确实支持经典 ASP。

(我之前甚至没有听说过 IIS Express - 看起来是一种很有前途的方法,可以让开发人员的计算机运行站点的本地副本,而无需配置成熟的 IIS 的复杂性)。

请参阅 Scott Guthrie 的博客。

我还没有找到在经典 ASP 中设置断点等的方法。如果除了在 ASP DLL 中设置断点(这几乎毫无用处)之外以任何方式支持这一点,我会非常非常惊讶。

Surprisingly, IIS Express DOES support classic ASP, unlike Cassini.

(I hadn't even heard of IIS Express before now - looks like a promising way to get developer's machines running a local copy of the site without the complexity of configuring full-blown IIS).

See this blog from Scott Guthrie.

I have not found a way to set breakpoints, etc in classic ASP. I would be very, very surprised if this was supported in any way other than setting break points within the ASP DLL (which will be near useless).

假装不在乎 2024-10-15 23:01:32

另请参阅我回答的这个问题。

IIS Express 和 Classic ASP

调试经典 ASP 仍然有点碰运气,但它是可行的

see also this question to which I answered.

IIS Express and Classic ASP

It's still a little hit and miss debugging classic asp but it is doable

清晰传感 2024-10-15 23:01:32

我发现做到这一点的唯一方法是遵循 Scott Guthrie 的博客,如 David Lively 的回答中所发布。将站点设置为允许 F5Ctrl + F5 启动应用程序后。您需要安装 IIS 5/6/7 并将站点添加为根目录或虚拟目录。因此,您同时拥有 IIS Express 和 IIS Express。 IIS 完全成熟,指向同一物理目录。现在启动 IIS 实例。就我而言,我只是导航到本地主机。这将启动 w3wp.exe 现在在 VSS 中附加到进程 W3wp.exe。

除此之外。我不相信有一个真正的解决方案可以在 IIS Express 中调试 ASP classic。

The only way I have found to do this is to follow Scott Guthrie's blog as posted in David Lively's answer. Once you have the site set up to allow F5 or Ctrl + F5 start the app. You will need to have installed IIS 5/6/7 and add the site as either the root, or a virtual directory. So you have both IIS express & IIS full blown pointing to the same physical directory. Now fire up the IIS instance. In my case I just navigate to localhost. this will start w3wp.exe Now in VSS attach to process W3wp.exe.

Other than this. I don't believe there is a true solution to debugging ASP classic in IIS Express.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文