VS2015/2013/2012 IIS Express Debug Classic ASP

参考资料:

https://msdn.microsoft.com/en-us/library/ms241740(v=vs.100).aspx

When you attach to an ASP Web application, make sure you select the appropriate program types in the Attach To Process dialog box. When you debug script, Managed code must not be selected.

http://weblogs.asp.net/akjoshi/Debugging-classic-asp-application-with-Visual-Studio-2005

http://weblogs.asp.net/dixin/debugging-classic-asp-with-visual-studio-2013

http://stackoverflow.com/questions/4520960/does-iis-express-support-debugging-classic-asp/27948911#27948911

http://stackoverflow.com/questions/19760878/application-debugging-is-disabled-in-visual-studio-2012-on-classic-asp-debugging

 

1. 如果你在 VS 中按 F5 启动调试的话, 默认是 Managed code. 是无法调试 ASP 页面的.

 

2. 首先, 修改 C:\Users\dotd\Documents\IISExpress\config\applicationhost.config, 将 <asp> 部分修改为如下:

<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>

 

3. 在 CMD 中用如下命令启动 iis express

iisexpress /config:C:\Users\dotd\Documents\IISExpress\config\applicationhost.config /site:ASPDemo

 

4. 在 VS 中用 "附加到进程" 附加到 iisexpress.exe 的进程, 注意 "附加到" 选项选择 "脚本" (因为是ASP) 而不是 "托管" (这是 ASP.NET的默认方式).

 

5. 先在浏览器中访问一次你要调试的页面 (这一步很重要, 是后续步骤的基础).

 

6. 如果你做了第5步的话, 在 VS 中 "解决方案资源管理器" 你应该可以看到类似如下的情形

 

7. 好, 现在打开 "脚本文档" 下面的  hello.asp (而不是本地目录的 hello.asp) 打断点. (看到那个"动态"了么, 这意味着你打的断点才能被Debugger知道).

 

8. 重新访问该页面, 命中断点.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值