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

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

问题描述

好吧,所以我最近在一个非常简单的专有语言中花费了几年的时间,进入了Web开发的世界,我的第一个工作就是为我们的客户之一调整旧的经典ASP页面。
我使用Visual Studio 2008来尝试调试我遇到的一些问题,但是该页面根本就不会加载。如果我使用IIS在本地浏览网站,那么一切都没有任何麻烦,所以我不知道我做错了什么。



这是我得到的错误消息;

 编译器错误消息:BC30451:名称'VariableName'未声明。 

这是设置的方式,file1.asp有一个包含file2.asp

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

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

 < FORM METHOD =POSTACTION =/ includes / file3.asp> 

内部file3.asp是创建变量的位置。



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

任何人都可以给我船吗?我一直在做很多谷歌搜索和阅读其他网站,似乎处理这个问题,但很多都在我的头上。
如果有人可以请时间来解释什么&为什么会发生这种情况,以及提供某种解决方案,或指向我可能能够帮助的地方,这将不胜感激。



Cheers,



Pat。

解决方案

可以在Visual Studio 2008中调试经典的ASP。这样做的方法涉及将调试器附加到运行ASP页面的进程。请记住,经典ASP调试仅适用于IIS;它不适用于VS开发Web服务器(Cassini)。另外,请确保您在IIS中启用了ASP调试:



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






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



如上所述,在IIS中进行配置后,如下所示:调试器:


  1. 在Visual Studio中打开Classic ASP文件

  2. 将任何位置设置为断点在服务器端代码中断

  3. 在Web浏览器中查看页面(确保主机进程正在运行)

  4. 在Visual Studio中:调试菜单 - >附加到进程

  5. 找到IIS ASP工作进程(IIS6上的w3wp.exe,IIS5.1上的dllhost.exe)

  6. Attac h到主机进程的脚本代码(见下面的例子)

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



此时,断点应该绑定,您应该可以调试经典ASP页面。 (您可能必须刷新Web浏览器中的页面,以便在附加调试器后再次执行代码)


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.

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

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

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

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

Inside file3.asp is where the variable is created.

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.

Cheers,

Pat.

解决方案

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 Home Directory Properties http://img4.imageshack.us/img4/6431/capturert.png


IIS Application Configuration http://img26.imageshack.us/img26/4802/capture2qr.png

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

  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)

Attach Debugger Dialog http://img43.imageshack.us/img43/2218/capturegb.png

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天全站免登陆