经典的 ASP 超级新手问题 [英] Classic ASP super newbie question

查看:17
本文介绍了经典的 ASP 超级新手问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,所以我在用一种非常简单的专有语言进行了几年编码之后,最近进入了 Web 开发的世界,我的第一份工作是为我们的一个客户调整一个旧的经典 ASP 页面.我正在使用 Visual Studio 2008 尝试调试我遇到的一些问题,但页面根本无法加载.如果我使用 IIS 在本地浏览网站,那么一切正常,没有任何问题,所以我不确定我做错了什么.

OK, So I have recently moved into the world of Web development after spending quite a few years coding in a pretty simple proprietary language, and one of my first jobs is to tweak an old classic ASP page for one of our clients. I'm using Visual Studio 2008 to try debug some problems I am having, but the page won't load at all. If I browse the site locally using IIS, then everything works without any trouble at all, so I am not sure what I am doing wrong.

这是我收到的错误消息;

Here's the error message I get;

Compiler Error Message: BC30451: Name 'VariableName' is not declared.

设置的方式是 file1.asp 包含 file2.asp

The way this is setup, is that file1.asp has an include for file2.asp

<!-- #include file=./includes/file2.asp -->

然后file2.asp有一个file3.asp的表单帖子

Then file2.asp has a form post for file3.asp

<FORM METHOD="POST" ACTION="/includes/file3.asp">

file3.asp 里面是创建变量的地方.

Inside file3.asp is where the variable is created.

所以,当通过 IIS 运行这个站点时,一切正常,变量看起来在文件之间传递没有任何问题,但是当我尝试使用 VS2008 调试站点时,我得到了 BC30451 错误代码.

So, when running this site via IIS, everything works, the variables look to be passed between files without any trouble, but when I try to debug the site using VS2008, I get the BC30451 error code.

有人可以修理我的船吗?我一直在做很多谷歌搜索和阅读其他似乎处理这个问题的网站,但其中很多都超出了我的想象.如果有人可以请花时间解释什么&为什么会发生这种情况,以及提供某种解决方案,或者将我指向可以提供帮助的某个方向,我们将不胜感激.

Can anyone right my ship? I've been doing a lot of googling and reading of other websites that seem to deal with this issue, but a lot of it is going over my head. If anyone could please take the time to explain what & why this is happening, as well as providing some kind of solution, or pointing me in the direction of somewhere that may be able to help, it would be more than greatly appreciated.

干杯,

拍拍

推荐答案

可以在 Visual Studio 2008 中调试经典 ASP.方法是将调试器附加到运行您的ASP 页面.请记住,经典 ASP 调试仅适用于 IIS;它不适用于 VS Development Web Server (Cassini). 另外,请确保您已在 IIS 中启用 ASP 调试:

You can debug classic ASP in Visual Studio 2008. The way to do it involves attaching the debugger to the process that is running your ASP pages. Keeping in mind that Classic ASP debugging only works with IIS; it does not work with the VS Development Web Server (Cassini). Also, make sure that you have enabled ASP debugging in IIS:

IIS 主目录属性 http://img4.imageshack.us/img4/6431/capturert.png

IIS 应用程序配置 http://img26.imageshack.us/img26/4802/capture2qr.png

在 IIS 中完成上述配置后,以下是附加调试器的方法:

Once you have the configuration in IIS as noted above, here is how to attach the debugger:

  1. 在 Visual Studio 中打开经典 ASP 文件
  2. 在服务器端代码中要中断的任何位置设置断点
  3. 在网络浏览器中查看页面(确保宿主进程正在运行)
  4. 在 Visual Studio 中:调试菜单 -> 附加到进程
  5. 找到 IIS ASP 工作进程(IIS6 上的 w3wp.exe,IIS5.1 上的 dllhost.exe)
  6. 附加到宿主进程的脚本代码(参见下面的示例)
  1. Open the Classic ASP files in Visual Studio
  2. Set a breakpoint anywhere you want to break in the server-side code
  3. View the page in a web browser (ensures that the host process is running)
  4. In Visual Studio: Debug Menu -> Attach to Process
  5. Locate the IIS ASP worker process (w3wp.exe on IIS6, dllhost.exe on IIS5.1)
  6. Attach to the script code for the host process (see below for example)

附加调试器对话框 http://img43.imageshack.us/img43/2218/capturegb.png

此时,断点应该绑定并且您应该能够调试经典 ASP 页面.(您可能需要在 Web 浏览器中刷新页面才能在附加调试器后再次执行代码)

At this point, the breakpoint should bind and you should be able to debug the Classic ASP pages. (you may have to refresh the page in the web browser to get the code to execute again once the debugger has been attached)

这篇关于经典的 ASP 超级新手问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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