How can i view Debug.Write?

I

Ian Boyd

IIS5, on a Windows 2000 Server machine.

Debeg.WriteLine "Hello, world!"


How can i view it?
 
B

Bob Barrows [MVP]

Ian said:
IIS5, on a Windows 2000 Server machine.

Debeg.WriteLine "Hello, world!"


How can i view it?
I know of no debugger for classic ASP-based script that supplies a Debug
object similar to the one used in VB, which is what I presume you are
talking about. As Mike says, you pretty much have to resort to
Response.write, of create your own custom debugging class:
http://support.microsoft.com/kb/299986/EN-US/
 
M

Mike Brind

Mike said:
That's gone wayyyyyyyyy over my head.

Oh, hold on a minute. I Googled your odd phrase, and it appears to be
some kind of sarcastic put-down. So I asked myself why I had earned
that reaction, and did a bit more googling.

Now I kind of thought that you were coming from a VBA/VB6 direction,
and trying to apply those debugging practices to classic asp, hence my
answer. At first, I didn't spot that your post had changed from
debug.write in the subject to debeg[sic].writeLINE in the body, but
debug.writeline is used in VB.NET (maybe other places as well, for all
I know), which suggests to me that you are using ASP.NET.

If that's the case, you're in the wrong group, and I select number 3 in
the this list (http://www.pushback.com/fun/BestComebacks.html) for you.
 
I

Ian Boyd

IIS5, on a Windows 2000 Server machine.
Debeg.WriteLine "Hello, world!"


How can i view it?

<%
Response.Write "Hello World"
%>


Let me clarify.

i'm coming into "ASP Programming" from C/C++ WinAPI programming.

It turns out that "ASP code" is actually VBScript, and it looks like the ASP
ISAPI extension for IIS uses the windows scripting engine. One of the
features available in the VBScripting engine is an intrinsic object called
Debug, which has two useful methods
Debug.Write
and
Debug.WriteLine

Unfortunaly, i cannot find where the ASP ISAPI extension for IIS puts the
"console output" on the web server; it doesn't output it as
OutputDebugStrings. Nor can i find any generally available "console" for
IIS.


Referring to your answer to my question: how does <%Response.Write()%> help
me view the output of Debug.Write?

If that's the case, you're in the wrong group, and I select number 3 in
the this list (http://www.pushback.com/fun/BestComebacks.html) for you.

Good show old man, very well played.
 
E

Evertjan.

Ian Boyd wrote on 03 jun 2006 in
microsoft.public.inetserver.asp.general:
It turns out that "ASP code" is actually VBScript,

No,
the ASP platform supports two scripting languages: VBscript and Jscript.
and it looks like
the ASP ISAPI extension for IIS uses the windows scripting engine. One
of the features available in the VBScripting engine is an intrinsic
object called Debug, which has two useful methods
Debug.Write

As ASP is on a server, it has no intrinsic console/human interface,
and a serverside output is not available.

The debug object would have no output so is not implemented.


Referring to your answer to my question: how does <%Response.Write()%>
help me view the output of Debug.Write?

<% Response.Write('Hello world') %>
or
<% = 'Hello world' %>
being minimal Jscript

<% Response.Write "Hello world" %>
or
<% = "Hello world" %>
being minimal VBscript
 
B

Bob Barrows [MVP]

Ian said:
It's not VB, it's VBScript
Umm, read my sentence again. Where did I say that I thought you were using
VB in ASP?
ASP uses the scripting engine. The scripting engine has "console
output".

But ASP doesn't, so this is not implemented.
Where does the ASP ISASP plugin for IIS, which is hosting the
scripting engine, redirect any "console" output to?

I just tried to debug a vbs file (using the debugger available in VS2003)
containing a debug.write statement and nothing appearred in the Immediate
window. Are you sure this works for vbscript files?
 
M

Mike Brind

Ian said:
Let me clarify.

i'm coming into "ASP Programming" from C/C++ WinAPI programming.

It turns out that "ASP code" is actually VBScript,

There is no such thing as "ASP code" as such, in just the same way as
there is no such thing as Dotnet code, for example. ASP is a
server-side technology for dynamically outputting html to the browser.
As Evertjan says, ASP supports a number of scripting languages.
VBScript is one of them, JScript, Javascript and Perl are others.

and it looks like the ASP
ISAPI extension for IIS uses the windows scripting engine. One of the
features available in the VBScripting engine is an intrinsic object called
Debug, which has two useful methods
Debug.Write
and
Debug.WriteLine

Unfortunaly, i cannot find where the ASP ISAPI extension for IIS puts the
"console output" on the web server; it doesn't output it as
OutputDebugStrings. Nor can i find any generally available "console" for
IIS.

That's because there is no console output in ASP. As I said in my
first post (which you completely dismissed), you have to output html to
a browser to debug your code. You do that by utilising the Response
object's Write method.
Referring to your answer to my question: how does <%Response.Write()%> help
me view the output of Debug.Write?

Debug.Write/WriteLine does not exist in ASP. Response.Write is its
equivalent.

Have you looked at ASP.NET instead? It might be a lot closer to what
you are used to. I would suggest that the learning curve for dotnet
wouldn't be so steep for you. It probably won't test your patience so
much.
 
A

Anthony Jones

Ian Boyd said:
Let me clarify.

i'm coming into "ASP Programming" from C/C++ WinAPI programming.

It turns out that "ASP code" is actually VBScript, and it looks like the ASP
ISAPI extension for IIS uses the windows scripting engine. One of the
features available in the VBScripting engine is an intrinsic object called
Debug, which has two useful methods
Debug.Write
and
Debug.WriteLine

Unfortunaly, i cannot find where the ASP ISAPI extension for IIS puts the
"console output" on the web server; it doesn't output it as
OutputDebugStrings. Nor can i find any generally available "console" for
IIS.

Dunno what "OutputDebugStrings" is, however it works fine for me in the VS
2003 output window.

See:-

http://msdn.microsoft.com/library/d...html/0530c5f1-c079-4d1a-aa42-b3f9bbf74e41.asp

Referring to your answer to my question: how does <%Response.Write()%> help
me view the output of Debug.Write?

It doesn't.
 
A

Anthony Jones

Bob Barrows said:
Umm, read my sentence again. Where did I say that I thought you were using
VB in ASP?

But ASP doesn't, so this is not implemented.


I just tried to debug a vbs file (using the debugger available in VS2003)
containing a debug.write statement and nothing appearred in the Immediate
window. Are you sure this works for vbscript files?

Use the output window set to debug (which is the only choice you have when
debugging ASP).
 
B

Bob Barrows [MVP]

Anthony said:
Use the output window set to debug (which is the only choice you have
when debugging ASP).
I wasn't debugging ASP. I was debugging a file called test.vbs. No ASP
involved.

It had just 3 lines:

stop
debug.write "test"
stop

But you're right. It somehow switched away from the output window without my
noticing it. I just tried again and, when I switched back to the output
window, the "test" was written to it. So it is certainly possible to use
debug.write in a vbs file.

Now to try it in ASP ...
 
B

Bob Barrows [MVP]

Anthony said:
Use the output window set to debug (which is the only choice you have
when debugging ASP).

You're right. It does work when debuggin an ASP process. Sorry Ian.
 
M

Mike Brind

Mike said:
There is no such thing as "ASP code" as such, in just the same way as
there is no such thing as Dotnet code, for example. ASP is a
server-side technology for dynamically outputting html to the browser.
As Evertjan says, ASP supports a number of scripting languages.
VBScript is one of them, JScript, Javascript and Perl are others.

and it looks like the ASP

Large portion of humble pie for me please.

Go to the properties of your application in IIS Management Console, and
click on the Configuration button. On the App Debugging tab, select
"Enable ASP server-side script debugging". That brings the Microsoft
Script Debugger into play (it's installed as part of IIS on Win 2000),
and will display error messages etc on the server (which is what you
asked for). You can start the debugger by using the code that Bob
showed, or by selecting it from Start -> Programs ->Accessories.

I'm not sure that Debug.Write works, but the command window allows you
to test the value of variables by typing ?variablename. I can't test
the Script Debugger, because I have VS 2003 installed on my machine,
and that seems to have replaced the script debugger - if I indeed ever
had it on XP Pro.

You have my apologies, of course.
 
M

Mike Brind

Mike said:
Large portion of humble pie for me please.

Go to the properties of your application in IIS Management Console, and
click on the Configuration button. On the App Debugging tab, select
"Enable ASP server-side script debugging". That brings the Microsoft
Script Debugger into play (it's installed as part of IIS on Win 2000),
and will display error messages etc on the server (which is what you
asked for). You can start the debugger by using the code that Bob
showed, or by selecting it from Start -> Programs ->Accessories.

I'm not sure that Debug.Write works,

It does. I downloaded the debugger from microsoft, and debug.write
outputs to the command window.
 
B

Bob Barrows [MVP]

Mike said:
It does. I downloaded the debugger from microsoft, and debug.write
outputs to the command window.
Yeah, i had never tried it. I alwasy just assumed it wouldn't work.
 
I

Ian Boyd

Debeg.WriteLine "Hello, world!"
How can i view it?

We seem to have strayed a bit.

Create a file on your web-server:

DebugTest.asp
===========
<% Debug.WriteLine("Hello, world!") %>

Can someone please sum up the IIS options, the ASP options, the programs,
the program options required to view this debug output?


i happen to have the Microsoft Script Debugger installed on my local
machine; and if i have it running while the web-server executes
DebugTest.asp, i do not see any output (at least not in the Call Stack,
Running Documents or Command Windows.)

i also happen to have Microsoft Visual Studio 2005 installed, and if i have
it running while the web-server executes DebugTest.asp, i do not see any
output. The web-site is in "medium" security (application pooling) mode, and
i do not see any debug output if i have attached the debugger to
dllhost.exe - perhaps i don't have the proper window up in VS2005
(View..Output does not show anything at any rate)

i am (right now) using the Windows XP built-in IIS, and i have configured
the options under
Website
->Properties
-> Home Directory
-> Configuration
-> App Debugging
X Enable ASP server-side script debugging
X Enable ASP client-side script debugging

NOTE: You cannot use the "Internet Information Services" management tool
that comes with Windows XP to set these options, you must use the IIS admin
tool on a Windows Server machine and connect back to your local computer.
The symtpons of it not working are: nothing happens when you push the
"Configuration" button.


i've never written VBScript outside of ASP. i've never used the Microsoft
Script Debugger outside of debugging Javascript from Internet Explorer.
 
B

Bob Barrows [MVP]

Ian said:
We seem to have strayed a bit.

Create a file on your web-server:

DebugTest.asp
===========
<% Debug.WriteLine("Hello, world!") %>

Can someone please sum up the IIS options, the ASP options, the
programs, the program options required to view this debug output?
In IIS Manager, set Application protection to Low, and go into the
Application properties and enable debugging.
I used a Stop statement in the code to force the debugger to attach to
the process.
i happen to have the Microsoft Script Debugger installed on my local
machine; and if i have it running while the web-server executes
DebugTest.asp, i do not see any output (at least not in the Call
Stack, Running Documents or Command Windows.)

I can't seem to make the debugger run standalone, but since you seem to
have discovered this trick, you need to attach the debugger to the asp
process being run. Using a Stop statement in the code makes this happen.
i also happen to have Microsoft Visual Studio 2005 installed, and if
i have it running while the web-server executes DebugTest.asp, i do
not see any output.

Have you attached it to the process? Look at the Debug menu, which
should contain an Attach to Process option.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top